Devfest SouthWest, Nigeria - Firebase

Devfest SouthWest, Nigeria - Firebase

This presentation contains an introduction to Firebase and walks through a code-lab for creating a real-time Android Chat application with offline functionality.

E803718649600ddffc1bc625d957e786?s=128

Moyinoluwa Adeyemi

November 28, 2015
Tweet

Transcript

  1. BUILDING REALTIME MOBILE APPS WITH FIREBASE Moyinoluwa ADEYEMI November 28,

    2015
  2. Firebase is a powerful platform for building realtime feature-rich apps

  3. Realtime Database NoSQL JSON data store Cross-platform client-side SDKs Restful

    API Works Offline Auto-scaling
  4. Authentication Anonymous Email / password Social Custom

  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. None
  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
  10. Connect your app to Firebase

  11. Edit your AndroidManifest.xml file First, request an INTERNET permission in

    the <manifest> tag Next, change the name of the application
  12. Create a Chat Model class

  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
  21. Implement offline functionality with Firebase With just one line of

    code… seriously
  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
  24. Twitter LinkedIn Github Moyinoluwa ADEYEMI Thank You!