MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
Loading...
Searching...
No Matches
android.h File Reference

Go to the source code of this file.

Functions

mln_status mln_android_init (void *jni_env, void *context, mln_diagnostic *out_diagnostic)

Detailed Description

Public C API declarations for Android process integration.

Function Documentation

◆ mln_android_init()

mln_status mln_android_init ( void * jni_env,
void * context,
mln_diagnostic * out_diagnostic )

Initializes Android platform services.

Required once per Android process, before creating a runtime. Configures locale services, TLS verification, and APK asset access. The host packages only the library, which carries the Java code that TLS verification calls.

jni_env must be a JNIEnv* valid for the calling thread. context must be an Android android.content.Context object. Any Context subtype may be passed. Successful initialization retains that Context's AssetManager for APK asset access. Pass an Activity or the application Context to read the app APK. TLS verification uses the process application context. All pointers are borrowed for the duration of the call.

May be called from any thread that is attached to the JVM.

Returns:

  • MLN_STATUS_OK when initialization succeeds or was already completed;
  • MLN_STATUS_INVALID_ARGUMENT when jni_env or context is null;
  • MLN_STATUS_UNSUPPORTED when this library was not built for Android;
  • MLN_STATUS_NATIVE_ERROR when platform initialization fails.