Kotzilla project file & API keys
To simplify API key management, the Kotzilla SDK uses a project file (kotzilla.json
) that centralizes configuration details, including the API key required for SDK operation. The following guide explains how to manually set up and manage this file, which is an alternative to the automatic process in the get started guide.
1. Generate an empty kotzilla project File
-
Ensure that the Kotzilla Gradle plugin is configured in your project. For more information on setting up the plugin, refer to the section called Update Gradle files in the get started guide.
-
To create a new, empty
kotzilla.json
project file, run the following Gradle task from your application module (e.g.,<project>/<app-module>
):./gradlew generateProjectFile
-
This command will generate the
kotzilla.json
file within the root of your application module folder (<project>/<app-module>/kotzilla.json
).
2. Understanding the Kotzilla project file
The kotzilla.json
file stores key configuration data for the Kotzilla SDK, including the SDK version and the API keys associated with your application packages. Here’s an example of what the kotzilla.json
file might look like:
{
"sdkVersion": "0.13.0",
"keys": [
{
"id": "019243...",
"applicationPackageName": "io.kotzilla.sample.androidx.debug",
"apiKey": "-onDeMWTi..."
}
]
}
3. Understanding API key management
The kotzilla.json
file allows the Kotzilla Gradle plugin to handle your application's API key, which is required for the Kotzilla SDK to operate.
The generateAndroidAssetsKey
Gradle task generates a secured API key container for your Android application, which is stored in the /assets
folder as the kotzilla.key
file.
The generateAndroidAssetsKey task is automatically triggered during the preBuild Gradle phase, so manual execution is typically unnecessary.