firebase

How to add Firebase to Android App | 2 Ways of Adding

In this article, I’ll show you how you adding Firebase to the android app. We’ll discuss the possible options and recommended ways of it. In addition, I will tell you preliminary information for the integration of Firebase. To do that, we’re going to build a sample application and add the firebase. So let’s begin.

To know more about Firebase please refer to the What is Firebase | All about Firebase

Prerequisites

To be able to follow this step-by-step Android chat app tutorial, you’ll need the following:

  1. The latest version of Android Studio
  2. A Firebase account

Two options are available to add firebase to your project.

1 way of adding->

–>first, go to the main menu and select Firebase as shown below figure.

firebase

–>Select Option as according to your necessity.

firebase

–>Connect your app to firebase: First.

  • After that Add the Firebase Authentication SDK to your app as shown in figure given below:
firebase

–>Firebase assistant is automatically added and install all necessary dependencies.


2 way of adding–>

–>Add Firebase to your app via a firebase console manually ​in this way you have to do all operations manually.

–> Go to

–>Let’s open the Firebase Console. Click Add project -> Enter project name ->  If you need analytics then check this option otherwise you can uncheck it. Click on a create a project.

firebase add project

–> Enter a name for your project and then click continue.

firebase

–> Click on Create Project and wait till it’s done. Then click on Continue.

firebase
firebase

–>Connect your Android Studio Project to Firebase project: Select Android as shown below.

firebase

–>Click on android, open this project and then pop up under the window. Here the package name is the big thing. This name must match the name of the android package.

how to add firebase in android studio, how to add firebase in android studio , how to add firebase in android studio , how to add firebase in android studio , how to add firebase in android studio , how to add firebase in android studio , how to add firebase in android studio , how to add firebase in android studio , how to add firebase in android studio , how to add fire, how to add firebase in android studio base in android studio , how to add firebase in android studio

firebase

–>Add the required details and SHA key.

To generate SHA key : Go to the Android Studio Project and press ctrl 2 times and Run Anything pop up in this pop-up type – signingReport and Enter.

–>The next step is to download the google-services.json file this file must be downloaded and placed in the app

firebase

–>Put this JSON file into the app folder in your app:

how to add firebase in android app,how to add firebase in android app,how to add firebase in android app,how to add firebase in android app,how to add firebase in android app,how to add firebase in android app,how to add firebase in android app

–>This is a very significant step. So let’s open your Project section  -> navigate to the app folder and paste it.

  • Modify project-level build.gradle in Android Studio and add SDK classpath.
dependencies {

classpath ‘com.google.gms:google-services:4.3.8’
}
  • Modify build.gradle(Module:app) in Android Studio and add dependency.
dependencies {

//Firebase
implementation platform(‘com.google.firebase:firebase-bom:28.4.0’)
implementation ‘com.google.firebase:firebase-auth-ktx’
implementation ‘com.google.android.gms:play-services-auth:19.2.0’
}
  • Modify build.gradle(Module:app) in Android Studio and add Plugin.
id ‘com.google.gms.google-services’

After modifying these files synchronize the project. Now your firebase setup is used.

For video tutorial refer to this:

  • We hope that this guide will assist you in understanding all about the concept of how to add firebase in android studio. We have concentrated on making a basic, meaningful and easy-to -learn guide to the concepts of adding firebase to android application with suitable examples. Still if you have any problems regarding this, please post them in the comment section, we will be glad to assist you.

This Post Has One Comment

Leave a Reply