- Create a Firebase project in the Firebase console.
- Add Firebase to your Android project by following the Firebase setup guide.
- In the Firebase console, enable Analytics for your project.
- Add the Firebase Analytics dependency to your app-level build.gradle file:
implementation 'com.google.firebase:firebase-analytics:<version>'
- Add the Google services plugin to your app-level build.gradle file:
apply plugin: 'com.google.gms.google-services'
- In your app's code, initialize Firebase Analytics in the onCreate() method of your application class:
FirebaseAnalytics.getInstance(this);
Your Firebase SDK for Analytics is now initiated and ready to use in your Android app.