This is the interface for the standard glue code of a threaded

application. In this model, the application's code is running in its own thread separate from the main thread of the process. It is not required that this thread be associated with the Java VM, although it will need to be in order to make JNI calls any Java objects.

Introduced properties

fun activity_state: Int

android :: NativeAppGlue :: activity_state

Current state of the app's activity. May be either APP_CMD_START,
fun config: AConfiguration

android :: NativeAppGlue :: config

The current configuration the app is running in.
fun destroy_requested: Bool

android :: NativeAppGlue :: destroy_requested

This is non-zero when the application's NativeActivity is being
fun input_queue: AInputQueue

android :: NativeAppGlue :: input_queue

When non-NULL, this is the input queue from which the app will
fun looper: ALooper

android :: NativeAppGlue :: looper

The ALooper associated with the app's thread.
fun ndk_native_activity: NdkNativeActivity

android :: NativeAppGlue :: ndk_native_activity

The ANativeActivity object instance that this app is running in.
fun saved_state: Pointer

android :: NativeAppGlue :: saved_state

This is the last instance's saved state, as provided at creation time.
fun window: ANativeWindow

android :: NativeAppGlue :: window

When non-NULL, this is the window surface that the app can draw in.

Redefined properties

redef type SELF: NativeAppGlue

android $ NativeAppGlue :: SELF

Type of this instance, automatically specialized in every class

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun activity_state: Int

android :: NativeAppGlue :: activity_state

Current state of the app's activity. May be either APP_CMD_START,
fun address_is_null: Bool

core :: Pointer :: address_is_null

Is the address behind this Object at NULL?
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun config: AConfiguration

android :: NativeAppGlue :: config

The current configuration the app is running in.
fun destroy_requested: Bool

android :: NativeAppGlue :: destroy_requested

This is non-zero when the application's NativeActivity is being
fun free

core :: Pointer :: free

Free the memory pointed by this pointer
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun input_queue: AInputQueue

android :: NativeAppGlue :: input_queue

When non-NULL, this is the input queue from which the app will
fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun looper: ALooper

android :: NativeAppGlue :: looper

The ALooper associated with the app's thread.
fun ndk_native_activity: NdkNativeActivity

android :: NativeAppGlue :: ndk_native_activity

The ANativeActivity object instance that this app is running in.
init nul: Pointer

core :: Pointer :: nul

C NULL pointer
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun saved_state: Pointer

android :: NativeAppGlue :: saved_state

This is the last instance's saved state, as provided at creation time.
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
fun window: ANativeWindow

android :: NativeAppGlue :: window

When non-NULL, this is the window surface that the app can draw in.
package_diagram android::NativeAppGlue NativeAppGlue core::Pointer Pointer android::NativeAppGlue->core::Pointer core::Object Object core::Pointer->core::Object ...core::Object ... ...core::Object->core::Object

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

extern class Pointer

core :: Pointer

Pointer classes are used to manipulate extern C structures.

Class definitions

android $ NativeAppGlue
# This is the interface for the standard glue code of a threaded
# application.  In this model, the application's code is running
# in its own thread separate from the main thread of the process.
# It is not required that this thread be associated with the Java
# VM, although it will need to be in order to make JNI calls any
# Java objects.
extern class NativeAppGlue `{ struct android_app* `}
	# We use the `userData` field of the C structure to store an handle to
	# the associated App
	private fun user_data: App `{ return self->userData; `}
	private fun user_data=(val: App) `{
		App_incr_ref(val);
		self->userData = val;
	`}

	# Fill this in with the function to process input events.  At this point
	# the event has already been pre-dispatched, and it will be finished upon
	# return.  Return 1 if you have handled the event, 0 for any default
	# dispatching.
	#int32_t (*onInputEvent)(struct android_app* app, AInputEvent* event);
	#fun set_input_event_handler(handler: App) `{  `}

	# The ANativeActivity object instance that this app is running in.
	fun ndk_native_activity: NdkNativeActivity `{ return self->activity; `}

	# The current configuration the app is running in.
	fun config: AConfiguration `{ return self->config; `}

	# This is the last instance's saved state, as provided at creation time.
	# It is NULL if there was no state.  You can use this as you need; the
	# memory will remain around until you call android_app_exec_cmd() for
	# APP_CMD_RESUME, at which point it will be freed and savedState set to NULL.
	# These variables should only be changed when processing a APP_CMD_SAVE_STATE,
	# at which point they will be initialized to NULL and you can malloc your
	# state and place the information here.  In that case the memory will be
	# freed for you later.
	fun saved_state: Pointer `{ return self->savedState; `}
	fun saved_state_size: Int `{ return self->savedStateSize; `}

	# The ALooper associated with the app's thread.
	fun looper: ALooper `{ return self->looper; `}

	# When non-NULL, this is the input queue from which the app will
	# receive user input events.
	fun input_queue: AInputQueue `{ return self->inputQueue; `}

	# When non-NULL, this is the window surface that the app can draw in.
	fun window: ANativeWindow `{ return self->window; `}

	# Current content rectangle of the window; this is the area where the
	# window's content should be placed to be seen by the user.
	#
	# TODO activate when we know what to return (returns a struct not a pointer)
	#fun content_self: ARect `{ return self->contentRect; `}

	# Current state of the app's activity.  May be either APP_CMD_START,
	# APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP; see below.
	fun activity_state: Int `{ return self->activityState; `}

	# This is non-zero when the application's NativeActivity is being
	# destroyed and waiting for the app thread to complete.
	fun destroy_requested: Bool `{ return self->destroyRequested; `}
end
lib/android/native_app_glue.nit:316,1--378,3