# GameActivity

`#include <GameActivity.h>`

This structure defines the native side of an android.app.GameActivity.

## Summary

It is created by the framework, and handed to the application's native code as it is being launched.

| ### Public attributes ||
|---|---|
| `https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity_1a5863f9eed57064d236535e423773f994` | `AAssetManager *` Pointer to the Asset Manager instance for the application. |
| `https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity_1a0233b996e546dc95b124d22897823a3a` | `struct https://developer.android.com/reference/games/game-activity/struct/game-activity-callbacks#struct_game_activity_callbacks *` Pointer to the callback function table of the native application. |
| `https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity_1a4713963307a829c65304702033bd160a` | `JNIEnv *` JNI context for the main thread of the app. |
| `https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity_1adc0adc34b3997c4f36f2819998d54a32` | `const char *` Path to this application's external (removable/mountable) data directory. |
| `https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity_1af4fe691b740a8c9225f5aefb2020da30` | `void *` This is the native instance of the application. |
| `https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity_1ae5b7d70ce6922959329498668308d423` | `const char *` Path to this application's internal data directory. |
| `https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity_1aeba66170613d110399acd3f59cb3eeeb` | `jobject` The [GameActivity](https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity) object handle. |
| `https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity_1a1f8e20a7bdfd2a52878a266732f95c77` | `const char *` Available starting with Honeycomb: path to the directory containing the application's OBB files (if any). |
| `https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity_1aeb844e72022ffe7e0a4bcc4f3fe0594c` | `int32_t` The platform's SDK version code. |
| `https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity_1aeaa58b1f565a8645720578a988149932` | `JavaVM *` The global handle on the process's Java VM. |

## Public attributes

### assetManager

```scdoc
AAssetManager * GameActivity::assetManager
```
Pointer to the Asset Manager instance for the application.

The application uses this to access binary assets bundled inside its own .apk file.

### callbacks

```scdoc
struct GameActivityCallbacks * GameActivity::callbacks
```
Pointer to the callback function table of the native application.

You can set the functions here to your own callbacks. The callbacks pointer itself here should not be changed; it is allocated and managed for you by the framework.

### env

```scdoc
JNIEnv * GameActivity::env
```
JNI context for the main thread of the app.

Note that this field can ONLY be used from the main thread of the process; that is, the thread that calls into the [GameActivityCallbacks](https://developer.android.com/reference/games/game-activity/struct/game-activity-callbacks#struct_game_activity_callbacks).

### externalDataPath

```gdscript
const char * GameActivity::externalDataPath
```
Path to this application's external (removable/mountable) data directory.

### instance

```scdoc
void * GameActivity::instance
```
This is the native instance of the application.

It is not used by the framework, but can be set by the application to its own instance state.

### internalDataPath

```gdscript
const char * GameActivity::internalDataPath
```
Path to this application's internal data directory.

### javaGameActivity

```text
jobject GameActivity::javaGameActivity
```
The [GameActivity](https://developer.android.com/reference/games/game-activity/struct/game-activity#struct_game_activity) object handle.

### obbPath

```gdscript
const char * GameActivity::obbPath
```
Available starting with Honeycomb: path to the directory containing the application's OBB files (if any).

If the app doesn't have any OBB files, this directory may not exist.

### sdkVersion

```scdoc
int32_t GameActivity::sdkVersion
```
The platform's SDK version code.

### vm

```scdoc
JavaVM * GameActivity::vm
```
The global handle on the process's Java VM.