This article will help you to integrate Firebase into your Android Project.
Prerequisite:
First, you need to create a project into Firebase Console, for that you can follow our guide Firebase integration for beginners.
Steps to Integrate Firebase into Your Android Project
1. Go to Firebase Console and click on your Project you just created in the previous step.
2. On the project page, you will see an option to add a platform into your Project, Click on Android Platform, as shown in the following screenshot.

Register App on Firebase
3. On the next page, add your App details, package name, Your App Nickname (App will be visible in Firebase Console with this name) And optional Signing Certificate SHA-1. I am not writing the steps here to generate a signing certificate, but you can have a look at our other article to see How to Generate Signing Certificate SHA-1. After filling the details press Register App button.

4. Firebase will automatically create a file named google-services.json
, you need to download it and add it to your project. For that open your Android Studio, From the left Project Pane, Click on the top dropdown and Choose Project and paste google-services.json
file under your App directory, as shown in the following screenshots.

5. Now you need to add Firebase SDK into your Android project, you can only add that SDK which service you need to use, like Firebase Authentication, Firebase Database, Storage and others. The list of latest versions of Firebase SDKs is here. Here I will only add Firebase Core, which provides Firebase Analytics.
In your Project level build.gradle
add following classpath
in dependencies
block.
classpath 'com.google.gms:google-services:4.3.2'
Also, make sure that Google’s Maven repository is present under repositories
& allprojects
block. like
repositories {
google()
jcenter()
}

6. Now open App level build.gradle file and add the dependency of your required Firebase SDK, as I will add the following Firebase Core SDK.
implementation 'com.google.firebase:firebase-core:17.2.0'
Also, apply Google plugin by adding the following line at the end of the App level build.gradle file
apply plugin: 'com.google.gms.google-services'
Screenshot of full App level build.gradle file

7. Finally, sync your project by pressing Sync Now button on the top right corner and you are done adding Firebase into your Android Project.
If you are working on Firebase Storage also have a look at
Hello.This post was really fascinating, especially since I was looking for thoughts on this matter last Friday.