Adding Firebase to your Android App

Adding Firebase to your Android App

If you’ve seen this post before, you’ll probably recognise that this long-winded unpolished article has changed quite a bit. Of course, I’ll only leave you with the best content! Any unpolished gems must be dealt with.

No need to bother with explaning why Firebase is so awesome. You already know that. That’s why you’re here. We’ll make this a quick and very straightforward one.

There are 2 methods by which you can add Firebase to your app. Using the Firebase Assistant, or manually.

Method 1: Using the Firebase Assistant

This is much quicker. Firebase Assistant is a tool in Android Studio that makes it so quick to connect Firebase to your app and add its dependencies for all its services.

  1. Open the Firebase Assistant by going to Tools > Firebase
  2. Click on the Analytics Menu
  3. Click Connect to Firebase and choose to either create a new Firebase project or connect to an existing one.
  4. Click the button below the previous one to add the dependencies to your  build.gradle files.

And voila. Now you have Firebase connected to your app in 4 quick steps! Plus the Firebase Core dependency which includes Analytics for your app which you can see on the Firebase Console.

Method 2: Doing it Manually

Maybe you don’t have Android Studio. Maybe you don’t want to use Firebase Assistant for… some other reason. I don’t know what that would be.

  1. Create a new Firebase project in the Firebase Console.
  2. Following the Android quickstart guide presented, register your app by adding its package name.
  3. Download the google-services.json file given and add it to your app’s root directory.
  4. Add the dependencies shown to the corresponding  build.gradle files.

Everything else along the way is pretty self-explanatory. It makes it easy to remember when you break it down into 4 simple steps.

Firebase Assistant isn’t showing on Android Studio

A common problem, this is. All you have to do is go to File > Settings/Preferences > Plugins and enable all the Firebase plugins.

 

So I definitely got this article shortened quite a bit. No pictures, no long-winded unnecessary explanations, just straight to the steps. I hope this works best for you guys. Tell me what you think!