package com.example.firebaseprojectsetup
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import android.widget.Button
import android.widget.TextView
import com.google.firebase.FirebaseApp
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val setupButton: Button = findViewById(R.id.setupButton)
val statusText: TextView = findViewById(R.id.statusText)
setupButton.setOnClickListener {
FirebaseApp.initializeApp(this)
statusText.text = "Setup Complete"
}
}
}We import FirebaseApp from the Firebase library. When the user taps the 'Start Setup' button, we call FirebaseApp.initializeApp(this) to initialize Firebase for the app context. After this, we update the status text to show 'Setup Complete' so the user knows the setup finished successfully.
This simple UI and logic demonstrate the basic Firebase setup step in an Android Kotlin app.