# Full Minimal Example (Copy/Paste) This is a complete minimal integration. You can paste it into a clean app and it will work with Bubbl once you add your API key and Firebase config. ## 1) `app/build.gradle.kts` ```kotlin plugins { id("com.android.application") id("org.jetbrains.kotlin.android") id("com.google.gms.google-services") } android { namespace = "com.example.mybubblapp" compileSdk = 34 defaultConfig { applicationId = "com.example.mybubblapp" minSdk = 26 targetSdk = 34 versionCode = 1 versionName = "1.0" } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { jvmTarget = "11" } } dependencies { implementation(platform("com.google.firebase:firebase-bom:33.3.0")) implementation("com.google.firebase:firebase-messaging-ktx") implementation("tech.bubbl:bubbl-sdk:2.0.9") implementation("com.google.android.gms:play-services-location:21.2.0") implementation("androidx.work:work-runtime-ktx:2.10.0") implementation("com.google.code.gson:gson:2.10.1") } ``` Dependency Set This is the smallest reliable dependency set for Bubbl + notifications. ## 2) `app/src/main/AndroidManifest.xml` ```xml ``` Background Location You can add `ACCESS_BACKGROUND_LOCATION` later if you need background tracking. ## 3) `MyApplication.kt` ```kotlin class MyApplication : Application() { override fun onCreate() { super.onCreate() if (FirebaseApp.getApps(this).isEmpty()) { FirebaseApp.initializeApp(this) } BubblSdk.init( application = this, config = BubblConfig( apiKey = "YOUR_API_KEY", environment = Environment.PRODUCTION, segmentationTags = emptyList(), geoPollInterval = 5 * 60_000L, defaultDistance = 10 ) ) } } ``` ## 4) `MainActivity.kt` ```kotlin class MainActivity : AppCompatActivity() { private val permMgr by lazy { PermissionManager(this) } private lateinit var permLauncher: ActivityResultLauncher> override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) permLauncher = permMgr.registerLauncher { granted -> if (granted) { BubblSdk.startLocationTracking(this) } } val granted = permMgr.locationGranted() && (Build.VERSION.SDK_INT < 33 || permMgr.notificationGranted()) if (granted) { BubblSdk.startLocationTracking(this) } else { permLauncher.launch(permMgr.requiredPermissions()) } handleNotificationIntent(intent) } override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) handleNotificationIntent(intent) } private fun handleNotificationIntent(intent: Intent?) { intent?.getStringExtra("payload")?.let { json -> val notification = Gson().fromJson( json, NotificationRouter.DomainNotification::class.java ) ModalFragment.newInstance(notification) .show(supportFragmentManager, "notification_modal") } } } ``` Optional Modal Handling If you do not use modals, you can remove `handleNotificationIntent` and the Gson dependency.