In this tutorial, we will learn how we can integrate firebase into our android applications. Overall integration process is very straight forward. We will need Android Studio for that, so if you don’t have it installed on your system, go ahead and download android studio from here. So without further ado, let’s start.
What is Firebase?
So What is Firebase? Firebase was founded by Andrew Lee and James Tamplin in 2011 and launched officially in April 2012. Originally, the system was intended to be a real-time database providing its APIs enabling users to store and sync data across different clients. However, the plans changed a little bit when Firebase was acquired by Google two years later after its release. Today, the Firebase service has a number of functions that really attract every developer.
Setting up Firebase
After you have successfully downloaded & installed the Android Studio, launch it and you will see with the following screen:
Go ahead and create a new android studio project. If everything went as expected, you should see the following screen:
Now let’s start working on integrating firebase into our android app. Head directly to the Android Studio menu bar. Click on the Tools menu option and you will see a list menu items. Click on the Firebase option and you should see the following screen.
A new Assistant section will be open. If not, go to the right side, to the Assistant section. There you will find the Firebase section, with all the features that firebase offer.
In this Firebase for Android tutorial, you will see, there are different firebase option. Firebase is a group of services, which means that each part is a service in itself. This also means that you’re free to select whatever service you want to include. For the sake of this tutorial, we’re taking the Realtime Database as the option to finalize the integration process.The integration process used in this example is applicable to all sorts of Firebase services in the exact same way.
Click on the Realtime Database option you will get a submenu with a simple explanation as to what the service actually does. Now, simply click on the Save and retrieve data link option and you will start a new process that will combine both authenticating as well as download and install the Firebase component in your android application.
You will need to configure your project by following the above steps. Next, you will need to authenticate and use the Gmail account related to your Firebase project. Once you have clicked on the link, you will need to select the Google account linked to your project. After that, you will need to authorize Android Studio to use your Google account. Then, whenever you approve those authorization rules, you will be redirected to the following firebase page.
Hurray! Our Android app is connected to the firebase. By now, you will see a new model popping up in your Android Studio. you will need to either select or create a new Firebase project. In our case, we have already created our FirebaseDemo project, so we will only need to select it and hit the Connect to Firebase button. After that, Android Studio will take a few seconds to connect to your project and configure your FirebaseDemo application and if everything went well, you will see the following output.
Congratulation, you have successfully connected your FirebaseDemo application to the firebase.
Best resources to learn firebase
- Firebase Cookbook: Over 70 recipes to help you create real-time web and mobile applications with Firebase
- Mastering Firebase for Android Development: Build real-time, scalable, and cloud-enabled Android apps with Firebase
- Basics Of Google Firebase For Web: Firebase 2019
- Build Mobile Apps with Ionic 4 and Firebase: Hybrid Mobile App Development