BUILDING REALTIME MOBILE APPS WITH FIREBASE
Moyinoluwa ADEYEMI
November 28, 2015
Slide 2
Slide 2 text
Firebase is a powerful platform for building realtime feature-rich apps
Slide 3
Slide 3 text
Realtime Database
NoSQL JSON data store
Cross-platform client-side
SDKs
Restful API
Works Offline
Auto-scaling
Slide 4
Slide 4 text
Authentication
Anonymous
Email / password
Social
Custom
Slide 5
Slide 5 text
Hosting
Free static asset hosting
SSL certificate
Global CDN
Single command deploys
One-click rollbacks
Custom domains
Slide 6
Slide 6 text
So you want to learn how to build a
realtime mobile chat application with Firebase?
Slide 7
Slide 7 text
No content
Slide 8
Slide 8 text
Sign up on https://www.firebase.com/ to get a firebase (data) url
Slide 9
Slide 9 text
Add the library dependency directly to your app’s gradle.build file
In cases of build errors caused by duplicate files, exclude those files by
adding these too
Slide 10
Slide 10 text
Connect your app to Firebase
Slide 11
Slide 11 text
Edit your AndroidManifest.xml file
First, request an INTERNET permission in the tag
Next, change the name of the application
Slide 12
Slide 12 text
Create a Chat Model class
Slide 13
Slide 13 text
Send a message to Firebase
Create a new Activity, complete with a layout that looks better than this.
Be sure to add a , an for collecting messages
and a for sending the data.
Slide 14
Slide 14 text
Send a message to Firebase
Create a reference to Firebase in the Activity and insert your own
firebase url.
Slide 15
Slide 15 text
Send a message to Firebase
Retrieve the text from the EditText and push to Firebase
Slide 16
Slide 16 text
Retrieve a message from Firebase
Create a layout for the chat. It could look like this, or even better
Slide 17
Slide 17 text
Retrieve a message from Firebase
Create a ChatAdapter class that extends FirebaseListAdapter
Slide 18
Slide 18 text
Retrieve a message from Firebase
Create a ChatAdapter class that extends FirebaseListAdapter
Slide 19
Slide 19 text
Retrieve a message from Firebase
Override onStart() in MainActivity to read and display the messages
Slide 20
Slide 20 text
Retrieve a message from Firebase
Override onStop() in MainActivity to remove all the data
Slide 21
Slide 21 text
Implement offline functionality with Firebase
With just one line of code… seriously
Slide 22
Slide 22 text
Woohoo!!!
You now have a very basic Firebase app that sends, receives, displays
messages and functions offline.
Slide 23
Slide 23 text
Credits
The official Firebase Chat App example was modified to produce this app.
The complete app including Login functionality implemented with
Firebase is available on Github here:
https://github.com/moyheen/LagosFirebaseCodelab