Introduction
The B2Metric Android SDK lets you send events to B2Metric. It provides automatic session tracking, push notification analytics, and offline support.
Quickstart
// Initialize in your Application class
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
B2MetricSDK.getInstance(this).start(
B2MetricAnalyticsConfig(
apiKey = "YOUR_API_KEY"
)
)
}
}
// Track events anywhere in your app
B2MetricSDK.getInstance(context).logEvent(
name = "button_clicked",
properties = mapOf("screen" to "home")
)