@@ -4,7 +4,6 @@ import android.os.Bundle
44import androidx.appcompat.app.AppCompatActivity
55import com.google.firebase.FirebaseApp
66import com.google.firebase.FirebaseOptions
7- import com.google.firebase.database.FirebaseDatabase
87import devrel.firebase.google.com.firebaseoptions.R
98
109class MainActivity : AppCompatActivity () {
@@ -14,22 +13,25 @@ class MainActivity : AppCompatActivity() {
1413 setContentView(R .layout.activity_main)
1514
1615 // [START firebase_options]
17- // Manually configure Firebase Options
16+ // Manually configure Firebase Options. The following fields are REQUIRED:
17+ // - Project ID
18+ // - App ID
19+ // - API Key
1820 val options = FirebaseOptions .Builder ()
19- .setApplicationId(" 1:27992087142:android:ce3b6448250083d1" ) // Required for Analytics.
20- .setApiKey(" AIzaSyADUe90ULnQDuGShD9W23RDP0xmeDc6Mvw" ) // Required for Auth.
21- .setDatabaseUrl(" https://myproject.firebaseio.com" ) // Required for RTDB.
21+ .setProjectId(" my-firebase-project" )
22+ .setApplicationId(" 1:27992087142:android:ce3b6448250083d1" )
23+ .setApiKey(" AIzaSyADUe90ULnQDuGShD9W23RDP0xmeDc6Mvw" )
24+ // setDatabaseURL(...)
25+ // setStorageBucket(...)
2226 .build()
2327 // [END firebase_options]
2428
2529 // [START firebase_secondary]
26- // Initialize with secondary app.
30+ // Initialize with secondary app
2731 FirebaseApp .initializeApp(this /* Context */ , options, " secondary" )
2832
29- // Retrieve secondary app.
33+ // Retrieve secondary FirebaseApp
3034 val secondary = FirebaseApp .getInstance(" secondary" )
31- // Get the database for the other app.
32- val secondaryDatabase = FirebaseDatabase .getInstance(secondary)
3335 // [END firebase_secondary]
3436 }
3537}
0 commit comments