# Storage

## Summary

| ### Enumerations ||
|---|---|
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1ga01aea4eb01aa6415eee118b5a5ee3dad{ https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada2a9c420e6008c108a7198fd861c042d5 = 1, https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada6710bb5b68cfc115eedcde2aafd8a667 = 2, https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada50642881107d6673aace1494a5d6fce2 = 20, https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada324da2b8fea5875339d442d1f2d0b45b = 21, https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada1f2b51b53fc57b57a9967f6ce0c88dbe = 22, https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada3ce8539aa8b531c9de1d16041322d7a8 = 23, https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada8b074af151167a965a550b9829fafb37 = 24, https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada2467a4b6a634680e12c288a7790ff66c = 25 }` | enumThe different states of a OBB storage passed to [AStorageManager_obbCallbackFunc()](https://developer.android.com/ndk/reference/group/storage#group___storage_1gab9afce75a6cdf2e8c128cdb5802be7bb). |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1gac9420823bfeba78fce625fc105e3b01d{ https://developer.android.com/ndk/reference/group/storage#group___storage_1ggac9420823bfeba78fce625fc105e3b01da33e2ae83b4c25d33a4335dccf1de1c3a = 0x0001 }` | enumFlag for an obb file, returned by [AObbInfo_getFlags()](https://developer.android.com/ndk/reference/group/storage#group___storage_1ga68d916570c756da9fd0d9096358300eb). |

| ### Typedefs ||
|---|---|
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1gaa5037fe4c0d785a50fc62ac2de9844c3` | typedef `struct https://developer.android.com/ndk/reference/group/storage#group___storage_1gaa5037fe4c0d785a50fc62ac2de9844c3` [AObbInfo](https://developer.android.com/ndk/reference/group/storage#group___storage_1gaa5037fe4c0d785a50fc62ac2de9844c3) is an opaque type representing information for obb storage. |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1ga419f40803228bca62e32beb911ab28e2` | typedef `struct https://developer.android.com/ndk/reference/group/storage#group___storage_1ga419f40803228bca62e32beb911ab28e2` [AStorageManager](https://developer.android.com/ndk/reference/group/storage#group___storage_1ga419f40803228bca62e32beb911ab28e2) manages application OBB storage, a pointer can be obtained with [AStorageManager_new()](https://developer.android.com/ndk/reference/group/storage#group___storage_1ga1c21ed9e0848fcfc03547c95eeb48877). |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1gab9afce75a6cdf2e8c128cdb5802be7bb)(const char *filename, const int32_t state, void *data)` | typedef `void(*` Callback function for asynchronous calls made on OBB files. |

| ### Functions ||
|---|---|
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1gaec5a4428008f545e829486099298031a(https://developer.android.com/ndk/reference/group/storage#group___storage_1gaa5037fe4c0d785a50fc62ac2de9844c3 *obbInfo)` | `void` Destroy the AObbInfo object. |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1ga68d916570c756da9fd0d9096358300eb(https://developer.android.com/ndk/reference/group/storage#group___storage_1gaa5037fe4c0d785a50fc62ac2de9844c3 *obbInfo)` | `int32_t` Get the flags of an OBB file. |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1ga1ec7eee61541fa5a9b578801a35b9cf3(https://developer.android.com/ndk/reference/group/storage#group___storage_1gaa5037fe4c0d785a50fc62ac2de9844c3 *obbInfo)` | `const char *` Get the package name for the OBB. |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1gacd8471c6d866cffe4a32f3b5997c782c(https://developer.android.com/ndk/reference/group/storage#group___storage_1gaa5037fe4c0d785a50fc62ac2de9844c3 *obbInfo)` | `int32_t` Get the version of an OBB file. |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1ga7beb4f82e3bf9a4b8197917f92ac4d5e(const char *filename)` | `https://developer.android.com/ndk/reference/group/storage#group___storage_1gaa5037fe4c0d785a50fc62ac2de9844c3 *` Scan an OBB and get information about it. |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1ga184c06dd9cec0f21db138167d6b331ed(https://developer.android.com/ndk/reference/group/storage#group___storage_1ga419f40803228bca62e32beb911ab28e2 *mgr)` | `void` Release AStorageManager instance. |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1gad5c90305d627e0c768da37cb3e9f08c4(https://developer.android.com/ndk/reference/group/storage#group___storage_1ga419f40803228bca62e32beb911ab28e2 *mgr, const char *filename)` | `const char *` Get the mounted path for an OBB. |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1ga7572f2c650fc16cce1b0ab94e913a1ba(https://developer.android.com/ndk/reference/group/storage#group___storage_1ga419f40803228bca62e32beb911ab28e2 *mgr, const char *filename)` | `int` Check whether an OBB is mounted. |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1ga61bebaf43e57b4b7f57e7a24a62e9e3d(https://developer.android.com/ndk/reference/group/storage#group___storage_1ga419f40803228bca62e32beb911ab28e2 *mgr, const char *filename, const char *key, https://developer.android.com/ndk/reference/group/storage#group___storage_1gab9afce75a6cdf2e8c128cdb5802be7bb cb, void *data)` | `void` Attempts to mount an OBB file. |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1ga1c21ed9e0848fcfc03547c95eeb48877()` | `https://developer.android.com/ndk/reference/group/storage#group___storage_1ga419f40803228bca62e32beb911ab28e2 *` Obtains a new instance of AStorageManager. |
| `https://developer.android.com/ndk/reference/group/storage#group___storage_1ga4c32c8d2c780016fa36097d833b57809(https://developer.android.com/ndk/reference/group/storage#group___storage_1ga419f40803228bca62e32beb911ab28e2 *mgr, const char *filename, const int force, https://developer.android.com/ndk/reference/group/storage#group___storage_1gab9afce75a6cdf2e8c128cdb5802be7bb cb, void *data)` | `void` Attempts to unmount an OBB file. |

## Enumerations

### Anonymous Enum 107

Declared in `android/storage_manager.h`

```text
 Anonymous Enum 107
```
The different states of a OBB storage passed to [AStorageManager_obbCallbackFunc()](https://developer.android.com/ndk/reference/group/storage#group___storage_1gab9afce75a6cdf2e8c128cdb5802be7bb).

| Properties ||
|---|---|
| `AOBB_STATE_ERROR_ALREADY_MOUNTED` | The OBB has already been mounted. Can be returned as the status for callbacks made during asynchronous OBB actions. |
| `AOBB_STATE_ERROR_COULD_NOT_MOUNT` | The OBB could not be mounted by the system. Can be returned as the status for callbacks made during asynchronous OBB actions. |
| `AOBB_STATE_ERROR_COULD_NOT_UNMOUNT` | The OBB could not be unmounted. This most likely indicates that a file is in use on the OBB. Can be returned as the status for callbacks made during asynchronous OBB actions. |
| `AOBB_STATE_ERROR_INTERNAL` | There was an internal system error encountered while trying to mount the OBB. Can be returned as the status for callbacks made during asynchronous OBB actions. |
| `AOBB_STATE_ERROR_NOT_MOUNTED` | A call was made to unmount the OBB when it was not mounted. Can be returned as the status for callbacks made during asynchronous OBB actions. |
| `AOBB_STATE_ERROR_PERMISSION_DENIED` | The current application does not have permission to use this OBB. This could be because the OBB indicates it's owned by a different package. Can be returned as the status for callbacks made during asynchronous OBB actions. |
| `AOBB_STATE_MOUNTED` | The OBB container is now mounted and ready for use. Can be returned as the status for callbacks made during asynchronous OBB actions. |
| `AOBB_STATE_UNMOUNTED` | The OBB container is now unmounted and not usable. Can be returned as the status for callbacks made during asynchronous OBB actions. |

### Anonymous Enum 56

Declared in `android/obb.h`

```text
 Anonymous Enum 56
```
Flag for an obb file, returned by [AObbInfo_getFlags()](https://developer.android.com/ndk/reference/group/storage#group___storage_1ga68d916570c756da9fd0d9096358300eb).

| Properties ||
|---|---|
| `AOBBINFO_OVERLAY` | overlay |

## Typedefs

### AObbInfo

Declared in `android/obb.h`

```text
struct AObbInfo AObbInfo
```
[AObbInfo](https://developer.android.com/ndk/reference/group/storage#group___storage_1gaa5037fe4c0d785a50fc62ac2de9844c3) is an opaque type representing information for obb storage.

### AStorageManager

Declared in `android/storage_manager.h`

```text
struct AStorageManager AStorageManager
```
[AStorageManager](https://developer.android.com/ndk/reference/group/storage#group___storage_1ga419f40803228bca62e32beb911ab28e2) manages application OBB storage, a pointer can be obtained with [AStorageManager_new()](https://developer.android.com/ndk/reference/group/storage#group___storage_1ga1c21ed9e0848fcfc03547c95eeb48877).

### AStorageManager_obbCallbackFunc

Declared in `android/storage_manager.h`

```gdscript
void(* AStorageManager_obbCallbackFunc)(const char *filename, const int32_t state, void *data)
```
Callback function for asynchronous calls made on OBB files.

"state" is one of the following constants:

- [AOBB_STATE_MOUNTED](https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada2a9c420e6008c108a7198fd861c042d5)
- [AOBB_STATE_UNMOUNTED](https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada6710bb5b68cfc115eedcde2aafd8a667)
- [AOBB_STATE_ERROR_INTERNAL](https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada50642881107d6673aace1494a5d6fce2)
- [AOBB_STATE_ERROR_COULD_NOT_MOUNT](https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada324da2b8fea5875339d442d1f2d0b45b)
- [AOBB_STATE_ERROR_COULD_NOT_UNMOUNT](https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada1f2b51b53fc57b57a9967f6ce0c88dbe)
- [AOBB_STATE_ERROR_NOT_MOUNTED](https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada3ce8539aa8b531c9de1d16041322d7a8)
- [AOBB_STATE_ERROR_ALREADY_MOUNTED](https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada8b074af151167a965a550b9829fafb37)
- [AOBB_STATE_ERROR_PERMISSION_DENIED](https://developer.android.com/ndk/reference/group/storage#group___storage_1gga01aea4eb01aa6415eee118b5a5ee3dada2467a4b6a634680e12c288a7790ff66c)

<br />

## Functions

### AObbInfo_delete

Declared in `android/obb.h`

```scdoc
void AObbInfo_delete(
  AObbInfo *obbInfo
)
```
Destroy the AObbInfo object.

You must call this when finished with the object.

### AObbInfo_getFlags

Declared in `android/obb.h`

```scdoc
int32_t AObbInfo_getFlags(
  AObbInfo *obbInfo
)
```
Get the flags of an OBB file.

### AObbInfo_getPackageName

Declared in `android/obb.h`

```gdscript
const char * AObbInfo_getPackageName(
  AObbInfo *obbInfo
)
```
Get the package name for the OBB.

### AObbInfo_getVersion

Declared in `android/obb.h`

```scdoc
int32_t AObbInfo_getVersion(
  AObbInfo *obbInfo
)
```
Get the version of an OBB file.

### AObbScanner_getObbInfo

Declared in `android/obb.h`

```gdscript
AObbInfo * AObbScanner_getObbInfo(
  const char *filename
)
```
Scan an OBB and get information about it.

### AStorageManager_delete

Declared in `android/storage_manager.h`

```scdoc
void AStorageManager_delete(
  AStorageManager *mgr
)
```
Release AStorageManager instance.

### AStorageManager_getMountedObbPath

Declared in `android/storage_manager.h`

```gdscript
const char * AStorageManager_getMountedObbPath(
  AStorageManager *mgr,
  const char *filename
)
```
Get the mounted path for an OBB.

### AStorageManager_isObbMounted

Declared in `android/storage_manager.h`

```gdscript
int AStorageManager_isObbMounted(
  AStorageManager *mgr,
  const char *filename
)
```
Check whether an OBB is mounted.

### AStorageManager_mountObb

Declared in `android/storage_manager.h`

```gdscript
void AStorageManager_mountObb(
  AStorageManager *mgr,
  const char *filename,
  const char *key,
  AStorageManager_obbCallbackFunc cb,
  void *data
)
```
Attempts to mount an OBB file.

This is an asynchronous operation.

Since API level 33, this function can only be used to mount unencrypted OBBs, i.e. the

```text
key 
```
parameter must be

```text
null 
```
or an empty string. Note that even before API level 33, mounting encrypted OBBs didn't work on many Android device implementations. Applications should not assume any particular behavior when

```text
key 
```
is nonempty.

<br />

### AStorageManager_new

Declared in `android/storage_manager.h`

```scdoc
AStorageManager * AStorageManager_new()
```
Obtains a new instance of AStorageManager.

### AStorageManager_unmountObb

Declared in `android/storage_manager.h`

```gdscript
void AStorageManager_unmountObb(
  AStorageManager *mgr,
  const char *filename,
  const int force,
  AStorageManager_obbCallbackFunc cb,
  void *data
)
```
Attempts to unmount an OBB file.

This is an asynchronous operation.