This presentation contains an introduction to Firebase and walks through a code-lab for creating a real-time Android Chat application with offline functionality.
5. Hosting
Free static asset hosting
SSL certificate
Global CDN
Single command deploys
One-click rollbacks
Custom domains
6. So you want to learn how to build a
realtime mobile chat application with Firebase?
7.
8. Sign up on https://www.firebase.com/ to get a firebase (data) url
9. 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
13. Send a message to Firebase
Create a new Activity, complete with a layout that looks better than this.
Be sure to add a <ListView />, an <EditText /> for collecting messages
and a <Button /> for sending the data.
14. Send a message to Firebase
Create a reference to Firebase in the Activity and insert your own
firebase url.
15. Send a message to Firebase
Retrieve the text from the EditText and push to Firebase
16. Retrieve a message from Firebase
Create a layout for the chat. It could look like this, or even better
17. Retrieve a message from Firebase
Create a ChatAdapter class that extends FirebaseListAdapter
18. Retrieve a message from Firebase
Create a ChatAdapter class that extends FirebaseListAdapter
19. Retrieve a message from Firebase
Override onStart() in MainActivity to read and display the messages
20. Retrieve a message from Firebase
Override onStop() in MainActivity to remove all the data
22. Woohoo!!!
You now have a very basic Firebase app that sends, receives, displays
messages and functions offline.
23. 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