How to Integrate firebase to android studio and visual studio code on windows

In this blog, we will be integrating firebase to android studio and visual studio code in windows. When it comes to databases firebase is known to be one of the best backend devices which provides databases, cloud storages, authentication, and other services provided by google. This blog will show you the step-by-step procedures in order for you to integrate the firebase to your android studio and visual studio code

PART 1: FIREBASE

Go to Firebase -> Create an Account -> Go to Console

Add your Project

After Clicking Add project it will be redirected you to the next page with 3 steps which includes the naming of the project and the configurations of the google analytics

After creating the project the user will be redirected to the firebase dashboard

PART 2: Connecting to Visual Studio Code (Web)

At the project overview there there are three buttons (ios, android, and web) -> Click the web icon (2 steps procedure)

First Step (Registering the App):

Enter the desired name of the app in web

Second Step (Adding of Firebase SDK):

Note: Firebase SDK allows your program to access the firebase libraries and services

In this step you need to open your Visual Studio Code:

Go to Terminal -> New Terminal (ctrl + shift + `) and enter “npm install firebase

After installing the firebase in your visual studio code you then copy the Firebase SDK on the second step

Note: Each datas from the FirebaseConfig is different from each other so it is required to copy what is written on the firebase website

After doing these steps you can now access and use your Firebase on your Visual Studio Code.

PART 3: Connecting to Android Studio (Android)

At the project overview there there are three buttons (ios, android, and web) -> Click the android icon (3 steps procedure)

Step 1 (App Registration):

Step 2 (Downloading and Adding Configuration File):

Download the provided file and open your Android Studio

Go to Android (Top Left of the screen below Project Name) select it and change it to Project

After going to project tab select the file downloaded and drag/paste it under the app file then revert the file back from project to Android

Step 3 (Adding Firebase SDK to Android Studio):

In you Android Studio (Android Tab) -> Gradle Scripts -> build.gradle (Project: *Project Name*) copy what is written in the firebase

In you Android Studio (Android Tab) -> Gradle Scripts -> build.gradle (Module: App) copy what is written in the firebase

Then we are done with setting up firebase in both Visual Studio Code and Android Studio

HOW TO USE FIREBASE IN ANDROID STUDIO

Go to Tools -> Firebase

After clicking the firebase a tab will show up which include all of the firebase services (example: Realtime Database)

After clicking get started with Realtime Database it will provide instructions on adding Realtime Database:

Connect to Firebase
Pick the database that you created earlier or any databases that you want to use

After selecting the database a window will pop-up which confirms that you are now connected to the database

Next Step (Adding Realtime Database SDK):

Select the Button and it will provide an instructions for you to do
Accept Changes and it will automatically allow create the required implementation and plugin for you

And then Repeat it with the other Firebase serivces which is included in the Android Studio if needed

And there you have it, you have now created and connected the Firebase to the Android Studio and Visual Studio Code

Leave a Comment

Your email address will not be published. Required fields are marked *