Firebase Setup
Firebase offers a suite of tools to enhance your mobile app, including crash reporting, analytics, and user authentication. Here’s how to get started with Firebase in three simple steps:
Create a Firebase Project
Head over to the Firebase console and click the Add project button. Give your project a descriptive name and follow the on-screen instructions to create it.
Register Your App with Firebase
Once your project is created, you’ll be taken to the project dashboard. Click the Add app button and select the Android platform. Follow the prompts to register your app. This will involve providing your app’s package name and optionally setting a nickname.
Download the google-services.json File
After registering your app, Firebase will prompt you to download a file named google-services.json
. This file contains essential configuration settings for your app to interact with Firebase services.
Place this downloaded google-services.json
file in the app
directory of your Android project.
If the download prompt doesn’t appear:
Go to the project settings by clicking the gear icon next to your project name and selecting Project settings.
In the settings page, navigate to the General tab and scroll down to the Your apps section. Click on the Android icon and then the google-services.json
button to download the file.
Note: for some Firebase features like Authentication, you’ll need to add your app’s SHA-1 fingerprint to the project. You can find this fingerprint by running the following command in your terminal, replacing placeholders with your specific details:
keytool -list -v -keystore "<path>" -alias "<alias>" -storepass "<password>" -keypass "<password>"
alternatively you can also use a built-in gradle task for this
./gradlew signingReport
The fingerprint can be found under the SHA certificate fingerprints section.
By following these steps, you’ve successfully set up Firebase for your Android app! Now you can leverage Firebase’s powerful tools to improve your app’s functionality and user experience.