![]() |
DDraceNetwork Documentation
|
Functions | |
| const char * | InitAndroid () |
| void | RestartAndroidApp () |
| bool | StartAndroidServer (const char **ppArguments, size_t NumArguments) |
| void | ExecuteAndroidServerCommand (const char *pCommand) |
| bool | IsAndroidServerRunning () |
Android-specific functions to interact with the ClientActivity.
Important note: These functions may only be called from the main native thread which is created by the SDLActivity (super class of ClientActivity), otherwise JNI calls are not possible because the JNI environment is not attached to that thread. See https://developer.android.com/training/articles/perf-jni#threads
| void ExecuteAndroidServerCommand | ( | const char * | pCommand | ) |
Adds a command to the execution queue of the local server.
| pCommand | The command to enqueue. |
| const char * InitAndroid | ( | ) |
Initializes the Android storage. Must be called on Android-systems before using any of the I/O and storage functions.
This will change the current working directory to the app specific external storage location and unpack the assets from the APK file to the data folder. The folder user is created in the external storage to store the user data.
Failure must be handled by exiting the app.
| bool IsAndroidServerRunning | ( | ) |
Returns whether the local server and its Android service are running.
| void RestartAndroidApp | ( | ) |
Sends an intent to the Android system to restart the app.
This will restart the main activity in a new task. The current process must immediately terminate after this function is called.
| bool StartAndroidServer | ( | const char ** | ppArguments, |
| size_t | NumArguments ) |
Starts the local server as an Android service.
This will request the notification-permission as it is required for foreground services to show a notification.
| ppArguments | Array of arguments to pass to the server on launch. |
| NumArguments | The number of arguments. |