Skip to main content

Module android

Module android 

Source
Expand description

Android NDK builds: the JNI cdylib for each ABI, installed into jniLibs/.

The JVM records and diffs on the host; an Android app needs the same library built for its ABIs instead. This links with the NDK’s clang directly, so cargo-ndk is not needed: the only moving parts are the linker path and the Rust target.

The recording step still runs on a desktop JVM (phase 3, on-device recording, is not implemented). What this adds is a library Gradle can package: <crate>/jniLibs/<abi>/lib*.so.

Structs§

Library
Options
Report

Enums§

Abi

Constants§

DEFAULT_ABIS
The ABIs built when --abi is not given: phones (64 and 32 bit) and emulators.
DEFAULT_API
The API level the libraries target when --api is not given.
MIN_API
The generated Java runtime uses java.util.Optional and java.util.function (API 24) and ThreadLocal.withInitial (API 26), so libraries built for a lower API would load but fail in the wrapper before the first call reaches Rust. API 26 is the honest floor.

Functions§

build
Builds the JNI library for each ABI and installs it under <out>/<abi>/.
check_api
The generated Java runtime needs API 26+ even though the NDK itself can link for API 21.
ndk_root
The NDK root: --ndk, then ANDROID_NDK_HOME/ANDROID_NDK_ROOT, then the newest complete NDK under ANDROID_HOME/ANDROID_SDK_ROOT, then the usual SDK folders.
sdk_folders