DDraceNetwork Docs
|
Functions | |
const char * | InitAndroid () |
void | RestartAndroidApp () |
bool | StartAndroidServer () |
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.
nullptr
on success, error message on failure. bool IsAndroidServerRunning | ( | ) |
Returns whether the local server and its Android service are running.
true
if the server is running, false
if the server is stopped. 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 | ( | ) |
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.
true
on success, false
on error.