How to connect an Android App to Firebase (Firebase Tutorial #1)

What is Firebase?

FireBase is a NoSQL Realtime Database that helps you store data of your app on Cloud without any hassle of creating and maintaining the server.

[the_ad id=”3168″]


Some of the key features provided by Firebase are listed below:

  • Realtime Database: Store your app data and sync them in seconds.
  • Authentication: Authenticate users simply and securely.
  • Cloud Storage: Store and serve files at Cloud without worrying about scalability.
  • Test lab for Android: Test your app on devices hosted by Google.
  • Crash Reporting: Find and prioritize bugs and fix them faster using Crash Reporting.
  • Cloud Functions: Run mobile backend code without managing servers. To know more click here.
  • Hosting: Deliver web app assets with speed and security.
  • Analytics: Get free and unlimited app analytics and know your audience.
  • Dynamic Links: Drive growth by using deep links with attribution.
  • Invites: Make it easy to share your app and content.
  • Admobs: Integrate ads in your app and start earning.
  • Cloud Messaging: Send targeted messages and notifications.
  • Remote Config: Modify your app without deploying a new version to Playstore.
  • App Indexing: Drive search traffic to your mobile app.
  • AdWords: Drive installs with targeted ad campaigns.

Connect an Android app to FireBase

Today in this tutorial, we are going to learn how to connect an Android app to Firebase.

[the_ad id=”2880″]


Step 1

If you already have an existing Android app, open it in Android Studio or create a new Android project. Open Firebase, go to the console and click on Add Project. Enter Project name and Country as shown below and then click on Create Project.


Step 2

Now click on ‘Add Firebase to your Android App’ and copy the package name of your app. All other fields are optional and can be left blank for now.


Step 3

Now download the google-services.json file and copy it to the app folder of your Android project.


Step 4

Copy first dependency in your app’s project level build.gradle. Now copy the second dependency at the bottom of the app level build.gradle file and click on Sync Now.

Step 5

If everything goes well, you will see your project added in the Firebase Console.


That’s it for now. In the next tutorial, we will learn how to integrate Email and Google Login using Firebase.

Site Footer

© 2018 The Engineer's Cafe. All Rights Reserved.