gpg:: AndroidInitialization
#include <android_initialization.h>
AndroidInitialization includes three initialization functions, exactly one of which must be called.
Summary
In the case of a standard Java Activity, JNI_OnLoad should be used. In the case of a NativeActivity where JNI_OnLoad will not be called, either android_main or ANativeActivity_onCreate should be used. android_main is used when building a NativeActivity using android_native_app_glue.h. ANativeActivity_onCreate is used when building a NativeActivity using just native_activity.h. android_native_app_glue.h and native_activity.h are default Android headers.
The appropriate initialization function must be called exactly once before any AndroidPlatformConfiguration instance methods are called, and it must be called before a GameServices object is instantiated. It is permitted to instantiate a AndroidPlatformConfiguration before one of the initialization calls (for example, if the configuration object has global scope), as long as no methods are called before the initialization call. These methods need be called only once in the lifetime of the calling program, not once per GameServices object created.
Public static functions |
|
---|---|
ANativeActivity_onCreate(ANativeActivity *native_activity, void *savedState, size_t savedStateSize)
|
void
When using Play Game Services with a NativeActivity which is based on only native_activity.h, ANativeActivity_onCreate should be called during your activity's ANativeActivity_onCreate, before any other Play Game Services calls.
|
JNI_OnLoad(JavaVM *jvm)
|
void
When using Play Game Services with a standard Java Activity, JNI_OnLoad should be called when the dynamic library's JNI_OnLoad is called.
|
android_main(struct android_app *app)
|
void
When using Play Game Services with a NativeActivity which is based on android_native_app_glue.h, android_main should be called during your activity's android_main, before any other Play Game Services calls.
|
Public static functions
ANativeActivity_onCreate
void gpg::AndroidInitialization::ANativeActivity_onCreate( ANativeActivity *native_activity, void *savedState, size_t savedStateSize )
When using Play Game Services with a NativeActivity which is based on only native_activity.h, ANativeActivity_onCreate should be called during your activity's ANativeActivity_onCreate, before any other Play Game Services calls.
JNI_OnLoad
void gpg::AndroidInitialization::JNI_OnLoad( JavaVM *jvm )
When using Play Game Services with a standard Java Activity, JNI_OnLoad should be called when the dynamic library's JNI_OnLoad is called.
android_main
void gpg::AndroidInitialization::android_main( struct android_app *app )
When using Play Game Services with a NativeActivity which is based on android_native_app_glue.h, android_main should be called during your activity's android_main, before any other Play Game Services calls.