End-to-end Android integration
Walk through a complete Zeta Android SDK integration, from an empty Android Studio project to receiving and tracking your first push notification.
On this page
- Prerequisites
- Step 1: Register your app in ZMP
- Step 2: Add the SDK
- Step 3: Set up Firebase
- Step 4: Initialize the SDK
- Step 5: Identify a user
- Step 6: Send a custom event
- Step 7: Set up push notifications
- Step 8: Verify in ZMP
Prerequisites
- Android Studio with Gradle 8.4+
- An Android device with Google Play Services (push notifications require a physical device)
- A ZMP account with mobile app registration access
- A Firebase project with Cloud Messaging enabled
Step 1: Register your app in ZMP
Follow the Mobile App Registration guide to register your app and obtain your clientSiteId and clientSecret.
Upload your Firebase Private Key JSON file during registration.
Step 2: Add the SDK
Add the Zeta SDK dependency to your module-level build.gradle.kts:
dependencies {
implementation("net.zetaglobal.app:core:1.0.0")
}
For detailed installation instructions, see Installation.
Step 3: Set up Firebase
Add Firebase Cloud Messaging to your project:
- Place your
google-services.jsonatandroid/app/google-services.json. - Add the Firebase dependency:
dependencies {
implementation("com.google.firebase:firebase-messaging:24.1.0")
}
The SDK's AAR manifest already declares ZTPushService — no manual manifest registration is needed.
Step 4: Initialize the SDK
Initialize the SDK in your Application.onCreate():
import net.zetaglobal.app.zetacore.ZTConfig
import net.zetaglobal.app.zetacore.ZetaClient
import net.zetaglobal.app.zetacore.network.ZTRegion
import net.zetaglobal.app.zetacore.common.ZTAppEnvironment
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
val config = ZTConfig(
clientSiteId = "your-site-id",
clientSecret = "your-secret", // load from secure storage
optIn = true,
region = ZTRegion.US,
appEnvironment = ZTAppEnvironment.PRODUCTION
)
ZetaClient.initialize(this, config)
}
}
For full configuration options, see Getting Started.
Step 5: Identify a user
After the user logs in, set their identity:
ZetaClient.user.builder()
.setUid("user-123")
.setEmail(ZTUserEmail(email = "[email protected]"))
.submit()
For the full identity API, see Contact Management.
Step 6: Send a custom event
Track a meaningful action:
ZetaClient.event.send(
eventName = "product_viewed",
properties = mapOf("product_id" to "SKU-456", "category" to "shoes")
)
Step 7: Set up push notifications
Configure the notification appearance:
val notificationConfig = ZTNotificationConfig(
smallIcon = R.drawable.ic_notification,
color = ContextCompat.getColor(this, R.color.notification_accent),
notificationChannel = ZTNotificationChannel(
id = "my_channel",
name = "My App Notifications",
description = "Notifications from My App"
)
)
ZTPush.initConfig(applicationContext, notificationConfig)
For Android 13+, request the POST_NOTIFICATIONS permission at runtime.
For the full push setup including deep linking and action callbacks, see Push Notifications.
Step 8: Verify in ZMP
- Open ZMP and navigate to your app's integration settings.
- Use the Test Integration feature with your device's BSIN.
- Send a test push notification.
- Confirm the notification appears on your device.
- Tap the notification and verify the
message_clickedevent in ZMP reporting.
Next steps
- In-App Messaging -- add foreground messages.
- App Inbox -- add a persistent message store.
- Data & Privacy -- review Google Play Data Safety requirements before release.
