In this blog, we give you a step-by-step tutorial on how to integrate Adobe Experience Platform Mobile SDKs with a Jetpack Compose application.
Jetpack Compose, which is becoming more and more popular, is Android’s modern toolkit for building native UI. It simplifies and accelerates UI development on Android and it brings your app to life with less code, powerful tools, and intuitive Kotlin APIs.
Initializing AEP Mobile SDK
Registering the extensions and initializing the Adobe Experience Platform Mobile SDKs when launching the application are required before making SDK API calls. This sample code is provided as a reference. For more information, see the documentation on “add initialization code”.
Jetpack Compose is designed to be compatible with the existing view-based UI approach. This means the Compose application should have at least one main activity launching composable UI elements on top of it.
To implement Lifecycle metrics in your application, override onResume and onPause functions in the main activity as shown in this sample code. For more information, see the documentation on Lifecycle metrics.