To get started, we need to integrate the Firebase SDK to the project, and it is a one-time integration. Later, we can choose any of the Firebase tools that we want to work with and add the appropriate gradle dependency.
To develop Firebase applications, you can surely use your development environment; the essential requirements are as follows:
- Your favorite operating system (Windows, macOS, or Linux)
- Determine whether you have the latest JRE installed on your operating system
- Install the latest version of JDK or Open JDK
- Install the newest version of Android Studio (at the time of writing, the most recent stable version is 2.3.3 and 3.0 is still in beta, or any newer version should also be excellent)
- Android SDK with one complete API will be very significant
There are two ways that you can connect Firebase to your Android project, from the Firebase console creating the new project and adding the dependencies and Google config file. The other way is just to add Firebase support to an Android project directly from Android Studio:
- The usual way of connecting Firebase is to visit the Firebase console at https://console.firebase.google.com/
- Create a new project using the
Add Project
button, and if you already have an existing project, you are free to choose it - In the overview section of the console, you can choose to add an Android application by clicking on the relevant button and add the necessary information to the fields
- Download the
google-services.json
file, add it to your project'sapp
folder root, and the classpath gradle dependencies in the project'sgradle
file - To reduce the effort, we can make Android Studio do all this for us by choosing the
Tools
|Firebase
menu option and clicking on the Firebase tools that you want to integrate from the list - After you chose the Firebase tool, tap on
Save
and retrieve data - In the next window panel, you will see options such as
Launch in the browser
,Connect your app to Firebase
, and so on, click on theConnect your app to Firebase
button and select your project or you can create the new project in theConnect to Firebase
window - Go back to the Firebase panel and click on the
Add the Realtime Database to your application
button
Since we have connected to Firebase, it is as simple as it sounds, all we have to do is select the Add the Realtime Database to your application
button in the Firebase assistance
window, you will see a dialog for requesting your authorization to change the gradle file with a few dependencies. Tap on Accept Changes
, now we are all set to explore Realtime Database abilities.