How to connect with Firebase Database using Android Studio?

Umesh Dananjaya
3 min readMar 1, 2021

Firebase

Firebase is a mobile platform that helps you develop high-quality apps it act act as backend platform for android and ISO.It is a Backend as a Service(BaaS) app development platform on google cloud platform.Firebase has no of different features that help the developer to develop mobile applications. Using Firebase database user can retrieve, save update, delete and search data. Firebase has real time database, different intuitive APIs in single SDK.

Real time database means Store and sync data with NoSQL cloud database. Data is stored as JSON and synchronized in realtime to every connected client and remains available when your app goes offline.

Advantages

> Move fast- intuitive APIs in single SDK is use to develop high quality and very fast working applications.

> No complicated -user an easily control using Firebase dashboard.

> Get free and Easy communication-Developer can free and they can communicate in online without any errors.

Steps

  1. Create new project in android studio “TestFirebaseApp”.
  2. Using menu bar of android studio IDE go to “Tool” and select Firebase.

3. In The Firebase window choose “Save and retrieve data” Under“Realtime Database”.

4. In save and retrieve data window First you should connect the your app to Firebase. Click on “Connect to Firebase”.(When you click on connect Firebase system automatically prompt the your google account to login.)

If You connect successfully you can see window like this.

5. Next click on “Add the Realtime Database to your app”.(You have to accept changes to some changes in android studio project enable to work with Firebase realtime database.)

if you correctly do the changes you can see like this.

6. using those two link you can read all the authentications and rules about Firebase database.

7. Using this link go to Firebase database console next go to “Realtime Database” using side bar next click on “create database”.

https://console.firebase.google.com

8. After click on “Create database” you have sat up the database.

first you have to choose the location where your realtime database date will be stored.

Next you have to choose what mode. select “Test mode” and enable.

Once you created database successfully you can see interface like this.

After finishing all the stages successfully you can write the database.

I hope in this article you have better idea about how to connect Firebase Database to Android studio.

Stay tuned. Thank you

--

--