Stay organized with collections
Save and categorize content based on your preferences.
ANativeActivity
This structure defines the native side of an android.app.NativeActivity.
Summary
It is created by the framework, and handed to the application's native code as it is being launched.
Public attributes
|
assetManager
|
Pointer to the Asset Manager instance for the application.
|
callbacks
|
Pointer to the callback function table of the native application.
|
clazz
|
jobject
The NativeActivity object handle.
|
env
|
JNIEnv *
JNI context for the main thread of the app.
|
externalDataPath
|
const char *
Path to this application's external (removable/mountable) data directory.
|
instance
|
void *
This is the native instance of the application.
|
internalDataPath
|
const char *
Path to this application's internal data directory.
|
obbPath
|
const char *
Available starting with Honeycomb: path to the directory containing the application's OBB files (if any).
|
sdkVersion
|
int32_t
The platform's SDK version code.
|
vm
|
JavaVM *
The global handle on the process's Java VM.
|
Public attributes
assetManager
Declared in android/native_activity.h
AAssetManager * ANativeActivity::assetManager
Pointer to the Asset Manager instance for the application.
The application uses this to access binary assets bundled inside its own .apk file.
callbacks
Declared in android/native_activity.h
struct ANativeActivityCallbacks * ANativeActivity::callbacks
Pointer to the callback function table of the native application.
You can set the functions here to your own callbacks. The callbacks pointer itself here should not be changed; it is allocated and managed for you by the framework.
clazz
Declared in android/native_activity.h
jobject ANativeActivity::clazz
The NativeActivity object handle.
IMPORTANT NOTE: This member is mis-named. It should really be named 'activity' instead of 'clazz', since it's a reference to the NativeActivity instance created by the system for you.
We unfortunately cannot change this without breaking NDK source-compatibility.
env
Declared in android/native_activity.h
JNIEnv * ANativeActivity::env
JNI context for the main thread of the app.
Note that this field can ONLY be used from the main thread of the process; that is, the thread that calls into the ANativeActivityCallbacks.
externalDataPath
Declared in android/native_activity.h
const char * ANativeActivity::externalDataPath
Path to this application's external (removable/mountable) data directory.
instance
Declared in android/native_activity.h
void * ANativeActivity::instance
This is the native instance of the application.
It is not used by the framework, but can be set by the application to its own instance state.
internalDataPath
Declared in android/native_activity.h
const char * ANativeActivity::internalDataPath
Path to this application's internal data directory.
obbPath
Declared in android/native_activity.h
const char * ANativeActivity::obbPath
Available starting with Honeycomb: path to the directory containing the application's OBB files (if any).
If the app doesn't have any OBB files, this directory may not exist.
sdkVersion
Declared in android/native_activity.h
int32_t ANativeActivity::sdkVersion
The platform's SDK version code.
vm
Declared in android/native_activity.h
JavaVM * ANativeActivity::vm
The global handle on the process's Java VM.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-11-19 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-19 UTC."],[],[],null,["# ANativeActivity Struct Reference\n\nANativeActivity\n===============\n\nThis structure defines the native side of an android.app.NativeActivity.\n\nSummary\n-------\n\nIt is created by the framework, and handed to the application's native code as it is being launched.\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [assetManager](#struct_a_native_activity_1a1053552e1b1e3487804afdb515b571d2) | [AAssetManager](/ndk/reference/group/asset#group___asset_1ga90c459935e76acf809b9ec90d1872771)` *` Pointer to the Asset Manager instance for the application. |\n| [callbacks](#struct_a_native_activity_1a71e56acc0188cc353ab3175f5cff756b) | `struct `[ANativeActivityCallbacks](/ndk/reference/struct/a-native-activity-callbacks#struct_a_native_activity_callbacks)` *` Pointer to the callback function table of the native application. |\n| [clazz](#struct_a_native_activity_1abbde1ec6b9af24c517a604f0d401b274) | `jobject` The NativeActivity object handle. |\n| [env](#struct_a_native_activity_1aa7d269ef5f9a9a7e381067e368e4a891) | `JNIEnv *` JNI context for the main thread of the app. |\n| [externalDataPath](#struct_a_native_activity_1a3ba7619559d9e34011b19b3a41d56209) | `const char *` Path to this application's external (removable/mountable) data directory. |\n| [instance](#struct_a_native_activity_1a5fefac7da2d59dfac0ad68ffb43c54f4) | `void *` This is the native instance of the application. |\n| [internalDataPath](#struct_a_native_activity_1a3dab19689aab0dac471208e89ba82581) | `const char *` Path to this application's internal data directory. |\n| [obbPath](#struct_a_native_activity_1a757aa036586fe3722c7a9e0bc87f827f) | `const char *` Available starting with Honeycomb: path to the directory containing the application's OBB files (if any). |\n| [sdkVersion](#struct_a_native_activity_1a07b0a31475d711a285713bcf0de770c9) | `int32_t` The platform's SDK version code. |\n| [vm](#struct_a_native_activity_1a71db04679afeb8c87ba18d398a7f9187) | `JavaVM *` The global handle on the process's Java VM. |\n\nPublic attributes\n-----------------\n\n### assetManager\n\nDeclared in `android/native_activity.h` \n\n```scdoc\nAAssetManager * ANativeActivity::assetManager\n``` \nPointer to the Asset Manager instance for the application.\n\nThe application uses this to access binary assets bundled inside its own .apk file. \n\n### callbacks\n\nDeclared in `android/native_activity.h` \n\n```scdoc\nstruct ANativeActivityCallbacks * ANativeActivity::callbacks\n``` \nPointer to the callback function table of the native application.\n\nYou can set the functions here to your own callbacks. The callbacks pointer itself here should not be changed; it is allocated and managed for you by the framework. \n\n### clazz\n\nDeclared in `android/native_activity.h` \n\n```text\njobject ANativeActivity::clazz\n``` \nThe NativeActivity object handle.\n\nIMPORTANT NOTE: This member is mis-named. It should really be named 'activity' instead of 'clazz', since it's a reference to the NativeActivity instance created by the system for you.\n\nWe unfortunately cannot change this without breaking NDK source-compatibility. \n\n### env\n\nDeclared in `android/native_activity.h` \n\n```scdoc\nJNIEnv * ANativeActivity::env\n``` \nJNI context for the main thread of the app.\n\nNote that this field can ONLY be used from the main thread of the process; that is, the thread that calls into the [ANativeActivityCallbacks](/ndk/reference/struct/a-native-activity-callbacks#struct_a_native_activity_callbacks). \n\n### externalDataPath\n\nDeclared in `android/native_activity.h` \n\n```gdscript\nconst char * ANativeActivity::externalDataPath\n``` \nPath to this application's external (removable/mountable) data directory. \n\n### instance\n\nDeclared in `android/native_activity.h` \n\n```scdoc\nvoid * ANativeActivity::instance\n``` \nThis is the native instance of the application.\n\nIt is not used by the framework, but can be set by the application to its own instance state. \n\n### internalDataPath\n\nDeclared in `android/native_activity.h` \n\n```gdscript\nconst char * ANativeActivity::internalDataPath\n``` \nPath to this application's internal data directory. \n\n### obbPath\n\nDeclared in `android/native_activity.h` \n\n```gdscript\nconst char * ANativeActivity::obbPath\n``` \nAvailable starting with Honeycomb: path to the directory containing the application's OBB files (if any).\n\nIf the app doesn't have any OBB files, this directory may not exist. \n\n### sdkVersion\n\nDeclared in `android/native_activity.h` \n\n```scdoc\nint32_t ANativeActivity::sdkVersion\n``` \nThe platform's SDK version code. \n\n### vm\n\nDeclared in `android/native_activity.h` \n\n```scdoc\nJavaVM * ANativeActivity::vm\n``` \nThe global handle on the process's Java VM."]]