Chapter 10 Firebase
Googles Firebase Service (https://console.firebase.google.com/) will provide authentication services and service to manage data.
Now we follow option 1 in https://firebase.google.com/docs/android/setup?hl=de#console.
Step 1: Create a Firebase Project
Now we follow option 1 in https://firebase.google.com/docs/android/setup?hl=de#console.
Navigate to the console and select Create a project. As Project name select Pluto25. Then press continue. Accept Google Analytics, select Default Account for Firebase and complete the process. Finally you should see a card like this:

Step 2: Register app with Firebase
This brings you the following screen:

Now download and add google-services.json {-} ans store the file in the directory shown in the figure above.
Step 3: Add Firebase SDK
Changes in the app level gradle-file
Add the line marked with “// <—“
plugins {
alias(libs.plugins.android.application)
id("com.google.gms.google-services") // <--
}
Scroll down to the dependencies section and again add the lines marked with // <—
dependencies {
implementation(platform("com.google.firebase:firebase-bom:33.5.1")) // <--
implementation("com.google.firebase:firebase-analytics") // <--
implementation("com.google.firebase:firebase-auth") // <-- Needed for auth
This is the final app level gradle-file:
plugins {
alias(libs.plugins.android.application)
id("com.google.gms.google-services") // <----
}
android {
namespace = "de.hawlandshut.pluto25"
compileSdk = 34
defaultConfig {
applicationId = "de.hawlandshut.pluto25"
minSdk = 25
targetSdk = 34
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
dependencies {
implementation(platform("com.google.firebase:firebase-bom:33.5.1")) // <--
implementation("com.google.firebase:firebase-analytics") // <--
implementation("com.google.firebase:firebase-auth") // <-- Needed for auth
implementation(libs.appcompat)
implementation(libs.material)
implementation(libs.activity)
implementation(libs.constraintlayout)
testImplementation(libs.junit)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core)
}