Skip to main content

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. It also includes steps for users migrating to SDK version 0.13.x or higher to ensure a smooth transition.

Migrate to SDK versions 0.13.x

For users migrating to SDK versions 0.13.x, the following steps are required to update your project:

  1. Download the Kotzilla Project File from your Application Settings page in the Kotzilla Console

  1. Place the Kotzilla.json file in the app-level module directory of your Android Studio project (e.g., <project-root>/app).

Generate an empty kotzilla project File

  1. 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.

  2. 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
  3. This command will generate the kotzilla.json file within the root of your application module folder (<project>/<app-module>/kotzilla.json).

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..."
}
]
}

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.

info

The generateAndroidAssetsKey task is automatically triggered during the preBuild Gradle phase, so manual execution is typically unnecessary.

note

If you need to change your project key, be sure also to delete your assets/kotzilla.key file to let the plugin regenerate a new key