Developed by Google, Firebase is a real-time database that stores and updates data on the cloud. We can use Firebase on various platforms including Android, iOS, and the web.
Firebase supports a JSON format for displaying data to users. A developer can perform basic CRUD (Create, Read, Update and Delete) operations using the Firebase database platform.
To use Firebase as our database, we have to register and create an account at the official Firebase website here.
Although Firebase works as a database, it also has various other usages, as shown in the illustration below.
Firebase comes with many advantages, as it reduces workload and saves costs for a developer. We mainly use this database because of the following benefits:
We use Firebase as an
We must properly integrate this database into our project by syncing the appropriate libraries and dependencies, available on Google’s official documentation site for Firebase, mentioned here.
Let’s get a better understanding of how to integrate Firebase by importing it into Android Studio.
Step 1. Go to Android Studio. If we don’t already have it, we must download and install it first. Create a new project.
Step 2. Once our empty project is fully loaded and Gradle files are synced properly, go to tools -> Firebase. Once a new window opens, locate and select Save and retrieve under the Realtime Database section.
Step 3. Connect our Firebase project and move to set our dependencies.
We can now apply CRUD operations using Firebase.
Firebase stores the real-time data in a JSON format. The format is described below.
Suppose we have an android application that asks the user for some input. Firebase stores that input in real-time and presents it in JSON format.
We can view this type of data on web browsers by locating the specific URL of the Firebase application.
Note: The Firebase application URL is visible on the Firebase webpage where we register the account.
Free Resources