Slide 1

Slide 1 text

FIREBASE for ANDROID By: Dhrumil Shah

Slide 2

Slide 2 text

The Realtime Backend for your App

Slide 3

Slide 3 text

Creating an app shouldn’t require managing complex infrastructure.

Slide 4

Slide 4 text

THE FULL STACK

Slide 5

Slide 5 text

The full stack is never really that simple

Slide 6

Slide 6 text

… and neither is the client side

Slide 7

Slide 7 text

The user doesn’t care about your backend

Slide 8

Slide 8 text

THE USER EXPECTS Speed Offline Multi-platform Simple Authentication

Slide 9

Slide 9 text

FIREBASE The Realtime Backend for your App

Slide 10

Slide 10 text

THE FIREBASE BACKEND

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

CLOUD DATABASE NoSQL data-store Returns JSON from a RESTful API

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

REALTIME DATA Whenever data is updated in Firebase, it sends the update down to every listening client

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

STORE DATA Firebase ref = new Firebase("https://.firebaseio.com/message"); ref.setValue("All the things");

Slide 17

Slide 17 text

SYNC DATA Firebase ref = new Firebase("https://.firebaseio.com/message"); ref.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot snapshot) { System.out.println(snapshot.getValue()); } @Override public void onCancelled(FirebaseError error) { } });

Slide 18

Slide 18 text

OFFLINE

Slide 19

Slide 19 text

INTERMITTENT OFFLINE What happens when you go through a tunnel? Firebase clients store a local cache of your data. When the user goes offline, the app still works as expected with the local cache.

Slide 20

Slide 20 text

ENTENDED OFFLINE What happens when you go on a flight? On mobile, Firebase persists data to a local store. The app will continue to work even across app restarts.

Slide 21

Slide 21 text

ONE LINE OF CODE Firebase.getDefaultConfig().setPersistenceEnabled(true);

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Firebase supports several forms of authentication Email & Password Google Twitter Facebook Github Anonymous … and even custom backends

Slide 24

Slide 24 text

AUTHENTICATION ref.authWithOAuthToken("google", "", new Firebase. AuthResultHandler() { @Override public void onAuthenticated(AuthData authData) { // the Google user is now authenticated with your Firebase app } @Override public void onAuthenticationError(FirebaseError firebaseError) { // there was an error } });

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

SECURITY By default everyone can read and write { "rules": { ".read": true, ".write": true, } }

Slide 27

Slide 27 text

SECURITY Everyone can read, but no one can write { "rules": { ".read": true, ".write": false, } }

Slide 28

Slide 28 text

SECURITY Secure specific parts of your firebase { "rules": { ".read": true, “message”: { ".write": false, } } }

Slide 29

Slide 29 text

WELL DOCUMENTED

Slide 30

Slide 30 text

FIREBASE META-DATA 276,348 registered developers 1M concurrent users on Firebase sites Joined Google October, 2014

Slide 31

Slide 31 text

FOCUS ON YOUR APP The user doesn’t care about the backend What matters is that your app is fast and enjoyable

Slide 32

Slide 32 text

QUESTIONS ?? http://www.dhuma1981.in

Slide 33

Slide 33 text

No content