Slide 1

Slide 1 text

Firebase: For Android Build better mobile apps and grow your business fast, without managing infrastructure. ~ Roger Taracha

Slide 2

Slide 2 text

About Me ● Software Engineer. ● Python, JS, Android ● Dance Choreographer. ● Traveling. ● Community Development. ● DIY Hobbyist. ● Learning Facilitator - Andela

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

Focus Area: Authentication

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

SHA1 of debug key: ● Enter the command above: ☝ ○ keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore ● The keystore password is android

Slide 8

Slide 8 text

SHA1 of debug key

Slide 9

Slide 9 text

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.

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Run on Emulator ● Edit the Manifest file and make sign up activity the Lancher Activity. ● Run app on emulator

Slide 17

Slide 17 text

Successful SignUp

Slide 18

Slide 18 text

Success!!

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

Successful Login

Slide 25

Slide 25 text

SUCCESS! I NOW KNOW

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

Thank you @thedancercodes TheDancerCodes thedancercodes