How to add Firebase to your Android Studio Project

Prerequisites

You need a device running Android 2.3 (Gingerbread) or newer devices.
NewImage
Make sure the device or emulator has a Google Play Services 9.0 or above.

NewImage

You need to make sure you have atl least Google Play Services rev 30 and Google Repository Rev 30. As per today we have Google Play services rev 33 and Google Repository rev 35. Always update this two repository.

There are plenty of sample code for Andorid and iOS here. You can also Quick Start from GitHub

Step to add firebase project.
 NewImage
1. Add firebase project in https://firebase.google.com/console/.


NewImage
2. Click Add Firebase to your Android app
NewImage
3.When prompted, enter your app's package name. It's important to enter the package name your app is using; this can only be set when you add an app to your Firebase project.

4. Doownload a google-services.json file and drag and drop the file in your android studio app folder.


NewImage

The Google services plugin for Gradle loads the google-services.json file that you just downloaded. Modify your build.gradle files to use the plugin.

  1. Project-level build.gradle (<project>/build.gradle):
    buildscript { dependencies {
        // Add this line
        classpath 'com.google.gms:google-services:3.0.0' } }
  2. App-level build.gradle (<project>/<app-module>/build.gradle):
    ...
    // Add to the bottom of the file
    apply plugin: 'com.google.gms.google-services'
    includes Firebase Analytics by default help_outline
  3. Finally, press "Sync now" in the bar that appears in the IDE:
The Google services plugin for Gradle loads the google-services.json file that you just downloaded. Modify your build.gradle files to use the plugin.

How to add Firebase to your Android Studio Project How to add Firebase to your Android Studio Project Reviewed by Admin on 10:51 PM Rating: 5

7 comments:

  1. Thanks for the detailed information about Android studio Project. I would love to see more such awesome blog posts from you. Keep up the Good Work! Thats why I love Gbwhatsapp for android, It has a lot of awesome features.

    ReplyDelete
  2. Essentially, for a short, widely inclusive answer: all these Android applications focus on cash and on the off chance that they are utilized, they will assist you with sparing some money! bluestacks 3 download for pc

    ReplyDelete
  3. Thanks a lot for sharing this info with us. Now, I can easily add firebase to my Android device. Download KineMaster Mods

    ReplyDelete
  4. Thank you for sharing this. It was helpful. Keep sharing such things.
    Also I like to play MLBB MOD APK which is more fun than any other game.

    ReplyDelete
  5. Nice article. All the sections of your site covered with great functions. I really like the content and discussions on your site. Thanks a lot for allowing me to join. I love to see more about GB WhatsApp 2022. Keep sharing and updating. Also share more posts with us. Thank you.

    ReplyDelete

Powered by Blogger.