.klyx file.
Prerequisites
- A Klyx-compatible device or emulator running Klyx 4.2.0+
- Basic knowledge of Kotlin and Jetpack Compose
Create the project
Create a new Android project in Android Studio with No Activity. Use minimum SDK 28 and Kotlin. Your project structure should look like this:Configure the version catalog
Ingradle/libs.versions.toml:
libs.versions.toml
3. Set up the root build file
Inbuild.gradle.kts:
build.gradle.kts
Configure the app module
Inapp/build.gradle.kts:
build.gradle.kts
Write the Android manifest
Inapp/src/main/AndroidManifest.xml:
AndroidManifest.xml
Create plugin.json
Inplugin.json (at the project root):
plugin.json
Implement the plugin
Inapp/src/main/java/com/myextension/MyPlugin.kt:
MyPlugin.kt
Build the bundle
Run the Gradle task:output/my-extension.klyx — a bundle containing your APK, plugin.json, and any assets.
Install on Klyx
Transfer the.klyx file to your device and open it with Klyx. Klyx detects the bundle, reads plugin.json, loads the APK, instantiates your entryClass, and calls onLoad() followed by onStart().
Navigate to your screen from within Klyx’s navigation.
Next steps
Plugin Manifest Reference
Full reference for plugin.json fields
Plugin Lifecycle
Understand load, start, stop, and unload