Add Firebase to Your Android Project

suggest change

Here are simplified steps (based on the official documentation) required to create a Firebase project and connect it with an Android app.

Add Firebase to your app

  1. Create a Firebase project in the Firebase console and click Create New Project.
  2. Click Add Firebase to your Android app and follow the setup steps.
  3. When prompted, enter your app’s package name.

It’s important to enter the fully qualified package name your app is using; this can only be set when you add an app to your Firebase project.

  1. At the end, you’ll download a google-services.json file. You can download this file again at any time.
  2. If you haven’t done so already, copy the google-services.json file into your project’s module folder, typically app/.

The next step is to Add the SDK to integrate the Firebase libraries in the project.

Add the SDK

To integrate the Firebase libraries into one of your own projects, you need to perform a few basic tasks to prepare your Android Studio project. You may have already done this as part of adding Firebase to your app.

  1. Add rules to your root-level build.gradle file, to include the google-services plugin:
buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

Then, in your module Gradle file (usually the app/build.gradle), add the apply plugin line at the bottom of the file to enable the Gradle plugin:

apply plugin: 'com.android.application'

android {
  // ...
}

dependencies {
  // ...
  compile 'com.google.firebase:firebase-core:11.0.4'
}

// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'

The final step is to add the dependencies for the Firebase SDK using one or more libraries available for the different Firebase features.

|Gradle Dependency Line | Service | |————————|–––––| |com.google.firebase:firebase-core:11.0.4 | Analytics| |com.google.firebase:firebase-database:11.0.4 | Realtime Database| |com.google.firebase:firebase-storage:11.0.4 | Storage| |com.google.firebase:firebase-crash:11.0.4 | Crash Reporting| |com.google.firebase:firebase-auth:11.0.4 | Authentication| |com.google.firebase:firebase-messaging:11.0.4 | Cloud Messaging / Notifications| |com.google.firebase:firebase-config:11.0.4 | Remote Config| |com.google.firebase:firebase-invites:11.0.4 | Invites / Dynamic Links| |com.google.firebase:firebase-ads:11.0.4 | AdMob| |com.google.android.gms:play-services-appindexing:11.0.4 | App Indexing|

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Firebase:
* Add Firebase to Your Android Project

Table Of Contents
2 Gradle
5 Intent
17 Service
19 WebView
31 SQLite
35 Glide
37 Dialog
38 ACRA
44 Handler
53 Toast
63 Menu
65 Picasso
70 Volley
71 Widgets
78 Realm
90 Spinner
95 OkHttp
99 Firebase
108 TextView
109 ListView
111 Loader
118 Xposed
119 Security
121 ImageView
123 Doze Mode
130 Drawables
131 Colors
134 Fresco
139 AdMob
145 Keyboard
146 Button
150 EditText
155 Vk SDK
163 ExoPlayer
169 XMPP
175 OpenCV
177 Threads
184 ORMLite
186 TabLayout
190 LruCache
192 Zip files
194 Fastlane
199 FileIO
202 Moshi
210 VideoView
216 Paint
218 ProGuard
226 CleverTap
228 ADB shell
229 Ping ICMP
230 AIDL
234 Context
240 JCodec
242 Okio
249 FuseView
254 Looper
261 Fastjson
263 Jackson
267 Smartcard