Adding Firebase to Android App

Published April 23, 2020

Developing a successful app is not easy. To reach a large number of audience we need to consider our Apps. 
To build  these applications we need to connect backend servers to store and retrieve data.

Google given These Storage option with Firebase.

In this post we are going to learn How to Integrate Android application with Firebase.

Let's get Started

We will build an app in android to show how to integrate with firebase as backend.
First ,create a new android project in Android studio.

To use Firebase in our application we need the google-services.json file in your project.
Follow these steps:
Step 1: Go to the Firebase console: https://console.firebase.google.com

  • Click on Add project.
    • Enter the name of the project, say “Firebase Auth” and click Create Project.

Fireabse

  • Click on Add Firebase to your Android app.

Firebase

  • Enter the following details in the popup modal:
    •  Android Project package name.
    •  Your systems SHA-1 key(To know more on how to generate a SHA-1 key from Android Studio click here).
    •  Give a name to your application(Optional).
    •  Click on REGISTER APP.

Firebase

Step 2:

Now that your have registered your application; download the google-services.json and put it in the app folder of your application

Firebase

 

add in project level gradle file

 dependencies {   
        classpath 'com.google.gms:google-services:4.3.3'
    }


    add app level gradle file

 apply plugin: 'com.google.gms.google-services


   Step 3: 
    That's it now syn project

Article Contributed By :
https://www.rrtutors.com/site_assets/profile/assets/img/avataaars.svg

517 Views