Skip to main content

Setup Android Library

Does your app use Koin context isolation like Android SDK and white-label apps? This solution is for you.

note

You need to have a Kotzilla account and having registered your application on the platform. See Signup Page

Gradle Setup

See Android Gradle Setup page for more details.

Get your Kotzilla Project file

See Android Project Setup page for more details.

info

The Kotzilla plugin will help to generate secured API key. You can overload this key with KOTZILLA_API_KEY environment variable.

See more about Kotzilla Project File.

SDK Standalone Instance

In your Kotlin app, you need to activate the Kotzilla platform with following code

  • KotzillaCoreSDK() - Create a new Kotzilla SDK instance
  • setup() - Setup Kotzilla platform with given App api Token and version name
  • connect() - Connect to Kotzilla platform
  • analyticsLogger(sdkInstance = ...) - Specify what Kotzilla instance to use in analytics
  • context.apiKey() - Android extension to retrieve the api key

To start and connect the SDK, you can do as follow:

// Setup & connect Kotzilla SDK
val instance = KotzillaCoreSDK()
.setup(context.apiKey(),"1.0")
.connect()

Attach your KotzillaSDK instance to your analyticsLogger:

// Start Koin
startKoin {
analyticsLogger(sdkInstance = instance)
modules(...)
}

Advanced Configuration

To configure manually a versionName(in case of Android Library project), you need to setup a plugin section like with the kotzilla section:

kotzilla {
// Android Library version
versionName = "1.0.0"
}
note

if your project is an Android library, be sure to setup the versionName in the plugin settings section.

Proguard Rules

Check the Android setup ProGuard page for rules to apply