What problem does it solve?
This Skill helps you write, review, and debug JNI code that connects Android Java or Kotlin with C or C++ native code, reducing crashes, memory leaks, and threading bugs across the native boundary.
Core Features & Use Cases
- Native method implementation: Define and name JNI entry points correctly for Java and Kotlin classes.
- Type and memory safety: Handle strings, arrays, local references, global references, and exception propagation without leaking resources.
- Threading and callbacks: Attach background native threads to the JVM, cache class and method IDs, and call Java listeners safely from C++.
- Use case: When an Android app needs to stream audio or process hardware data in native code, this Skill guides the JNI layer so the bridge is stable, efficient, and maintainable.
Quick Start
Use the android-jni skill to review or implement the JNI bridge for your Android class or method and check naming, type conversion, reference lifetimes, exceptions, and threading behavior.