package core:sys/android/native_app_glue
Warning: This was generated for -target:windows_amd64 and might not represent every target this package supports.
Index
Types (2)
Constants (21)
APP_… (17)
- APP_CMD_ACTIVITY_CHANGED
- APP_CMD_CONFIG_CHANGED
- APP_CMD_CONTENT_RECT_CHANGED
- APP_CMD_DESTROY
- APP_CMD_GAINED_FOCUS
- APP_CMD_INIT_WINDOW
- APP_CMD_INPUT_CHANGED
- APP_CMD_LOST_FOCUS
- APP_CMD_LOW_MEMORY
- APP_CMD_PAUSE
- APP_CMD_RESUME
- APP_CMD_SAVE_STATE
- APP_CMD_START
- APP_CMD_STOP
- APP_CMD_TERM_WINDOW
- APP_CMD_WINDOW_REDRAW_NEEDED
- APP_CMD_WINDOW_RESIZED
LOOPER_… (3)
- ODIN_ANDROID_STDIO_TO_LOGCAT
Variables (0)
This section is empty.
Procedure Groups (0)
This section is empty.
`#config` values (1)
Types
android_app ¶
android_app :: struct { userData: rawptr, onAppCmd: proc(app: ^android_app, cmd: i32), onInputEvent: proc(app: ^android_app, event: ^android.AInputEvent) -> i32, // Return 1 if the event was handled. activity: ^android.ANativeActivity, // nil while a recreated activity is replaced (`APP_CMD_ACTIVITY_CHANGED`). config: ^android.AConfiguration, // The state from the previous instance, if any. It must be allocated with `libc.malloc` (see `set_saved_state`). savedState: rawptr, savedStateSize: uint, looper: ^android.ALooper, inputQueue: ^android.AInputQueue, window: ^android.ANativeWindow, contentRect: android.ARect, activityState: i32, // `APP_CMD_START`, `APP_CMD_RESUME`, `APP_CMD_PAUSE` or `APP_CMD_STOP`. destroyRequested: i32, // Private to the glue. mutex: sync.Mutex, cond: sync.Cond, msgread: posix.FD, msgwrite: posix.FD, cmdPollSource: android_poll_source, inputPollSource: android_poll_source, running: bool, stateSaved: bool, destroyed: bool, pendingInputQueue: ^android.AInputQueue, pendingWindow: ^android.ANativeWindow, pendingActivity: ^android.ANativeActivity, }
Related Procedures With Parameters
android_poll_source ¶
android_poll_source :: struct { id: i32, app: ^android_app, process: proc(app: ^android_app, source: ^android_poll_source), }
The data pointer ALooper_pollOnce returns for LOOPER_ID_MAIN and LOOPER_ID_INPUT.
Constants
APP_CMD_ACTIVITY_CHANGED ¶
APP_CMD_ACTIVITY_CHANGED :: 16
activity is nil while a recreated activity goes, then the new one, with config.
APP_CMD_GAINED_FOCUS ¶
APP_CMD_GAINED_FOCUS :: 6
APP_CMD_LOST_FOCUS ¶
APP_CMD_LOST_FOCUS :: 7
APP_CMD_LOW_MEMORY ¶
APP_CMD_LOW_MEMORY :: 9
APP_CMD_PAUSE ¶
APP_CMD_PAUSE :: 13
APP_CMD_RESUME ¶
APP_CMD_RESUME :: 11
APP_CMD_START ¶
APP_CMD_START :: 10
APP_CMD_STOP ¶
APP_CMD_STOP :: 14
APP_CMD_TERM_WINDOW ¶
APP_CMD_TERM_WINDOW :: 2
window is about to go away. It is still valid during the command.
APP_CMD_WINDOW_REDRAW_NEEDED ¶
APP_CMD_WINDOW_REDRAW_NEEDED :: 4
APP_CMD_WINDOW_RESIZED ¶
APP_CMD_WINDOW_RESIZED :: 3
ODIN_ANDROID_STDIO_TO_LOGCAT ¶
ODIN_ANDROID_STDIO_TO_LOGCAT :: #config(ODIN_ANDROID_STDIO_TO_LOGCAT, true)
-define:ODIN_ANDROID_STDIO_TO_LOGCAT=true
Whether stdout and stderr go to logcat, tagged with the package name (see android.redirect_stdio_to_logcat).
Build with -define:ODIN_ANDROID_STDIO_TO_LOGCAT=false to leave them at /dev/null.
Variables
This section is empty.
Procedures
ANativeActivity_onCreate ¶
@(export) ANativeActivity_onCreate :: proc "c" ( activity: ^android.ANativeActivity, savedState: rawptr, savedStateSize: uint, ) {…}
android_app_post_exec_cmd ¶
android_app_post_exec_cmd :: proc "contextless" (app: ^android_app, cmd: i8) {…}
The glue's own handling of cmd, after onAppCmd.
android_app_pre_exec_cmd ¶
android_app_pre_exec_cmd :: proc "contextless" (app: ^android_app, cmd: i8) {…}
The glue's own handling of cmd, before onAppCmd.
android_app_read_cmd ¶
android_app_read_cmd :: proc "contextless" (app: ^android_app) -> i8 {…}
Read the next command from the activity. Returns -1 if none is waiting.
app ¶
app :: proc "contextless" () -> ^android_app {…}
The app of the process, which main runs with. Activities come and go under it.
set_saved_state ¶
set_saved_state :: proc "contextless" (app: ^android_app, data: []u8) {…}
Replace the saved state with a copy of data.
Call it while handling APP_CMD_SAVE_STATE. The copy is allocated with libc.malloc because the activity frees it.
Procedure Groups
This section is empty.
`#config` values
- ODIN_ANDROID_STDIO_TO_LOGCAT
-define:ODIN_ANDROID_STDIO_TO_LOGCAT=true
Source Files
Generation Information
Generated with odin version dev-2026-10 (vendor "odin") Windows_amd64 @ 2026-10-31 23:54:16.590839100 +0000 UTC