Step 1: Create a Firebase project
Before you can add Firebase to your Android app, you need to create a Firebase project to connect to your Android app. Visit Understand Firebase Projects to learn more about Firebase projects.
Create a Firebase project
- In the Firebase console, click Add project.
To add Firebase resources to an existing Google Cloud project, enter its project name or select it from the dropdown menu. - Click Continue.
- Click Create project (or Add Firebase, if you’re using an existing Google Cloud project).
Step 2: Register your app with Firebase
To use Firebase in your Android app, you need to register your app with your Firebase project. Registering your app is often called “adding” your app to your project.
- In the center of the project overview page, click the Android icon Android or Add app to launch the setup workflow.
- Enter your app’s package name in the Android package name field.
Find your app’s package name in your module (app-level) Gradle file, usuallyapp/build.gradle
(example package name:com.yourcompany.yourproject
).
Be aware that the package name value is case-sensitive, and it cannot be changed for this Firebase Android app after it’s registered with your Firebase project. - Enter other app information: App nickname
Step 3: Add a Firebase configuration file
Add the Firebase Android configuration file to your app:
- Click Download google-services.json to obtain your Firebase Android config file (
google-services.json
). - Move your config file into the module (app-level) directory of your app.
Comments
Post a Comment