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.
- Open the Firebase Assistant by going to Tools > Firebase
- Click on the Analytics Menu
- Click Connect to Firebase and choose to either create a new Firebase project or connect to an existing one.
- 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.
- Create a new Firebase project in the Firebase Console.
- Following the Android quickstart guide presented, register your app by adding its package name.
- Download the google-services.json file given and add it to your app’s root directory.
- 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 the Firebase plugins.
If you have encounter any other problems with getting your app connected to Firebase, leave them down in the comments. I’ll answer them straight away!