At this year's Google I/O, Google announced a number of interesting new features in Firebase. The new Firebase is said to be a “Unified app platform for mobile developers” adding new tools to help develop faster, improve app quality, engage users and monetize apps.
For a quick intro to what the new Firebase is about, you can watch this video.
The new features that are included in this new Firebase include:
First point to get started with Firebase, is to create an account here if you don't have one already.
Before you can begin to enjoy the new Firebase, please ensure your development machine satisfies these prerequisites:
Next step is to add Firebase to your app on the Firebase console. Follow the following steps to add firebase to your app.
Navigate to the console. If you don't already have an existing Firebase project, click on "Create new project" and follow through the steps as shown in the gif below. Else, if you have an exisiting Google project, click on "Import Google Project"
Now that you've created the project, in the dashboard, click on "Add Firebase to your Android app".
To proceed, you need at least a package name unique to your app. If you plan on using Dynamic Links, Invites, and Google Sign-In support in Auth, you have to include a debug signing key SHA1 fingerprint.
To see your debug key SHA1 fingerprint, run the following command if you use Linux or Mac:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
If you're running Windows, use this command:
keytool -list -v -keystore C:\Documents and Settings\[User Name]\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
The whole process is as shown below:
Clicking add app will download a google-services.json
file. You should move this file to your projects app module directory. Usually <project>/app
directory. Click continue and follow these instructions:
<project>/build.gradle
):buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:3.0.0'
}
}
<project>/<app-module>/build.gradle
):apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
implementation 'com.google.firebase:firebase-core:9.0.0'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
Sync your gradle files with the project and you're ready to go with firebase.
This guide was originally drafted by Segun Famisa.