Setup Android Library
Does your app use Koin context isolation like Android SDK and white-label apps? This solution is for you.
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.
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 instancesetup()
- Setup Kotzilla platform with given App api Token and version nameconnect()
- Connect to Kotzilla platformanalyticsLogger(sdkInstance = ...)
- Specify what Kotzilla instance to use in analyticscontext.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"
}
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