Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Firebase Codelab Slides

Introduction to Firebase Codelab Slides

These are slides to the codelab I facilitated at GDG DevFest Rift Valley on Saturday 18th November 2017.

Roger Taracha

November 18, 2017
Tweet

More Decks by Roger Taracha

Other Decks in Programming

Transcript

  1. Firebase: For Android Build better mobile apps and grow your

    business fast, without managing infrastructure. ~ Roger Taracha
  2. About Me • Software Engineer. • Python, JS, Android •

    Dance Choreographer. • Traveling. • Community Development. • DIY Hobbyist. • Learning Facilitator - Andela
  3. What is Firebase? Firebase is a Backend-as-a-Service — Baas Firebase frees developers

    to focus on crafting fantastic user experiences. You don’t need to manage servers. You don’t need to write APIs. Firebase is your server, your API and your datastore, all written so generically that you can modify it to suit most needs. Some firebase features: 1. Realtime Database 2. File Storage 3. Authentication 4. Hosting
  4. Installation Party ➔ Use the latest emulator image ◆ Emulator

    build tools for API version 26 ◆ Android SDK Manager-> SDK Tools • Google Play Services rev 30 or newer • Google Repository rev 26 or newer ➔ DevFest App Repo Link http://bit.ly/2jv1HZX
  5. Firebase Console Setup ◆ Go to main site: https://firebase.google.com/ ◆

    Create a new project. ◆ Add Firebase to your android app. ◆ Android Package name -> build.gradle/applicationId ◆ SHA1 hash of your debug key. (Process in next slide) ◆ Download google-services.json file
  6. SHA1 of debug key: • Enter the command above: ☝

    ◦ keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore • The keystore password is android
  7. Project Dependencies • Go to main site. https://firebase.google.com/docs/android/setup • Create

    a new branch name devfest-codelab • Open build.gradle located in project's home directory, add firebase dependency and Google's Maven repository: ◦ DevFestFirebaseApp/build.gradle • Add INTERNET Permissions in Manifest file to enable us make network calls. • Add Google Services file to app folder of your project. ◦ The project will not build without this file.
  8. Project Dependencies • Open app/build.gradle and add firebase auth dependency

    ◦ compile 'com.google.firebase:firebase-auth:11.6.0' • At the bottom of the file apply the plugin: ▪ apply plugin: 'com.google.gms.google-services' ▪ This plugin reads google-services.json file & injects some of its values into your build
  9. Signup Activity • Firebase provides createUserWithEmailAndPassword() method to create a

    new user with email and password data. • Use the link below to access the solution source code of SignUpActivity.java: ◦ Exercise: http://bit.ly/2AUmvyf ◦ Solution: http://bit.ly/2AIVug9
  10. Run on Emulator • Edit the Manifest file and make

    sign up activity the Lancher Activity. • Run app on emulator
  11. Login Activity • Firebase provides signInWithEmailAndPassword()method to sign in the

    user. • Use the link below to access the solution source code of LoginActivity: ◦ Exercise: http://bit.ly/2zMFBG4 ◦ Solution: http://bit.ly/2AOEqpN
  12. Further Reading 1. Official Firebase Documentation: https://firebase.google.com/docs/ 2. Firebase Blog:

    https://firebase.googleblog.com/ 3. Firebase Android Tutorials Youtube: https://www.youtube.com/watch?v=kDZYIhNkQoM&list=PLl- K7zZEsYLmxfvI4Ds2Atko79iVvxlaq