how to connect with firebase in android studio manually

To connect your Kotlin Android Studio project with Firebase manually, you need to follow these steps:

  1. Create a Firebase project: Go to the Firebase website (https://firebase.google.com/) and create a new project. Give it a name and select your preferred options.

  2. Add your app to the Firebase project: After creating the project, click on "Add app" and select the Android platform. Provide the package name for your app (usually found in the AndroidManifest.xml file) and click on "Register app".

  3. Download the google-services.json file: After registering your app, you will be prompted to download the google-services.json file. This file contains the configuration details for your app to connect with Firebase.

  4. Add the google-services.json file to your project: Place the downloaded google-services.json file in the app module of your Android Studio project. Make sure the file is located inside the app folder.

  5. Add the Firebase SDK dependencies to your project: Open your project's build.gradle file (located in the root directory) and add the following dependencies:

buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

allprojects {
    // ...
    repositories {
        // ...
        mavenCentral()
    }
}

And in your app module's build.gradle file (located in the app folder), add the following dependencies:

dependencies {
    // ...
    implementation 'com.google.firebase:firebase-analytics:18.0.3'
    implementation 'com.google.firebase:firebase-auth:21.0.1'
    // Add more Firebase dependencies as needed
}
  1. Apply the Firebase plugin: Still in the build.gradle file of your app module, add the following line at the bottom:
apply plugin: 'com.google.gms.google-services'
  1. Sync your project: Sync your project with the Gradle files by clicking on the "Sync Now" button in the toolbar.

That's it! Your Kotlin Android Studio project is now connected with Firebase. You can start using Firebase services in your app by following the Firebase documentation and integrating the required APIs in your code.