# Play Asset Delivery

# Play Asset Delivery

Native API for Play Asset Delivery.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ### Enumerations                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| [AssetPackDownloadStatus](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga3cc7824aafc85614d5454355d996914c)`{` ` `[ASSET_PACK_UNKNOWN](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914cacc9f1b8ad928749995b2dfa67414bfee)` = 0,` ` `[ASSET_PACK_DOWNLOAD_PENDING](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca1a681fbb373a05ea3369cda8ee9884a3)` = 1,` ` `[ASSET_PACK_DOWNLOADING](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca2a4676f34beecc881b57f794aab7283b)` = 2,` ` `[ASSET_PACK_TRANSFERRING](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca1ae7548c957d833f2c203d56ae40781e)` = 3,` ` `[ASSET_PACK_DOWNLOAD_COMPLETED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca559b7cf34f1132ee60e62b9479933a49)` = 4,` ` `[ASSET_PACK_DOWNLOAD_FAILED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca76a5d3ba57b0dac905678acea8b8ec2f)` = 5,` ` `[ASSET_PACK_DOWNLOAD_CANCELED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca65d77713248176791f86ab2dbcd6f464)` = 6,` ` `[ASSET_PACK_WAITING_FOR_WIFI](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca410f1ac57bebb70681a395387a7a08c8)` = 7,` ` `[ASSET_PACK_NOT_INSTALLED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca01c4e7ea1883ca10496e2ef0990b38e0)` = 8,` ` `[ASSET_PACK_REQUIRES_USER_CONFIRMATION](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca8c3307a638fdd01d6f4de622d7f6c15e)` = 9,` ` `[ASSET_PACK_INFO_PENDING](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca652564162f815ff436890d4e70b3df73)` = 100,` ` `[ASSET_PACK_INFO_FAILED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca3c50d541016ee2c7b326333312865368)` = 101,` ` `[ASSET_PACK_REMOVAL_PENDING](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914cafaa7c599ca7ad25d91345fbe19b43c16)` = 110,` ` `[ASSET_PACK_REMOVAL_FAILED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga3cc7824aafc85614d5454355d996914ca7786cad77503212decff26799f8eb533)` = 111` `}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | enum The status associated with asset pack download operations.                           |
| [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e)`{` ` `[ASSET_PACK_APP_UNAVAILABLE](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03ea7d3ffab78be441e410aeddaa1e1a4c43)` = -1,` ` `[ASSET_PACK_UNAVAILABLE](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03eade82ca415473f66f23736699dae3b6aa)` = -2,` ` `[ASSET_PACK_INVALID_REQUEST](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03eabf7a64c43da40ea4c6c892855455ecce)` = -3,` ` `[ASSET_PACK_DOWNLOAD_NOT_FOUND](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03ea7eb9400b095de9010e6e3b8a4a40b887)` = -4,` ` `[ASSET_PACK_API_NOT_AVAILABLE](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03eaecbd50093ef483a4f143a7bbef47ddfc)` = -5,` ` `[ASSET_PACK_NETWORK_ERROR](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03ea237d921c7dd004036b023e6aa7a598e0)` = -6,` ` `[ASSET_PACK_ACCESS_DENIED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03ea8368c7109572882a0b9533ddabe11e66)` = -7,` ` `[ASSET_PACK_INSUFFICIENT_STORAGE](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03eaf4233f5025f18d37672a46d09bcd4345)` = -10,` ` `[ASSET_PACK_PLAY_STORE_NOT_FOUND](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03ea74d14524ceb05f2415275f5544dac06e)` = -11,` ` `[ASSET_PACK_NETWORK_UNRESTRICTED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03ea544d751574d97c4c58a9a4dba51fc945)` = -12,` ` `[ASSET_PACK_APP_NOT_OWNED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03eaaa3b3500a2d0764db75ee6a9d21bdfec)` = -13,` ` `[ASSET_PACK_CONFIRMATION_NOT_REQUIRED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03ea2265905e303e8c924bcd33f92a8485d0)` = -14,` ` `[ASSET_PACK_UNRECOGNIZED_INSTALLATION](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03ea11b46562e8fd88efc8337403ae8ea677)` = -15,` ` `[ASSET_PACK_INTERNAL_ERROR](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03ea1f984b7c4c84eab758ebd49e6bb82ac1)` = -100,` ` `[ASSET_PACK_INITIALIZATION_NEEDED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03ea60fbcd0491a565c637c492682318415b)` = -101,` ` `[ASSET_PACK_INITIALIZATION_FAILED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggab72339a7d36069c9bcd9dbc4059bb03eaaacc486b91529b13f902cdb94a6fd0d9)` = -102` `}` | enum An error code associated with asset pack operations.                                 |
| [AssetPackStorageMethod](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga7645ddff77635faf6b5f38f9ab0e69a0)`{` ` `[ASSET_PACK_STORAGE_FILES](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga7645ddff77635faf6b5f38f9ab0e69a0a25cad518d4e78dcfffa768bd4498f0d7)` = 0,` ` `[ASSET_PACK_STORAGE_APK](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga7645ddff77635faf6b5f38f9ab0e69a0aae1e14fd7746bd023d8d3d0e4b1099cb)` = 1,` ` `[ASSET_PACK_STORAGE_UNKNOWN](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga7645ddff77635faf6b5f38f9ab0e69a0aae2d890704d6885a11048d84da7a3eff)` = 100,` ` `[ASSET_PACK_STORAGE_NOT_INSTALLED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga7645ddff77635faf6b5f38f9ab0e69a0a903847e7615e4f9d1b9705f45964f46f)` = 101` `}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | enum The method used to store an asset pack on the device.                                |
| [ShowCellularDataConfirmationStatus](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga5662eb2d02d8ead7f81fa0a4ae35ca61)`{` ` `[ASSET_PACK_CONFIRM_UNKNOWN](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga5662eb2d02d8ead7f81fa0a4ae35ca61ae893da025cd6997ecabe489ad5daa667)` = 0,` ` `[ASSET_PACK_CONFIRM_PENDING](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga5662eb2d02d8ead7f81fa0a4ae35ca61add9ad1c85fbcfcb3cf6f683866547793)` = 1,` ` `[ASSET_PACK_CONFIRM_USER_APPROVED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga5662eb2d02d8ead7f81fa0a4ae35ca61abd109eef4935ea942cc1135794aeb7e1)` = 2,` ` `[ASSET_PACK_CONFIRM_USER_CANCELED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gga5662eb2d02d8ead7f81fa0a4ae35ca61a57971c4d9408b9d7fb84eae37837d660)` = 3` `}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | enum The status associated with a request to display a cellular data confirmation dialog. |
| [ShowConfirmationDialogStatus](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gad745b23323040cb1e285f49d8fb33848)`{` ` `[ASSET_PACK_CONFIRMATION_DIALOG_UNKNOWN](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggad745b23323040cb1e285f49d8fb33848a2b16b0dcd2e59a932b0863ca2497bf32)` = 0,` ` `[ASSET_PACK_CONFIRMATION_DIALOG_PENDING](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggad745b23323040cb1e285f49d8fb33848a187aae42265760f89e4727f7e2ef550f)` = 1,` ` `[ASSET_PACK_CONFIRMATION_DIALOG_APPROVED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggad745b23323040cb1e285f49d8fb33848a99bb3b379b641e0cbfcb92ae480dbcd4)` = 2,` ` `[ASSET_PACK_CONFIRMATION_DIALOG_CANCELED](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ggad745b23323040cb1e285f49d8fb33848a940b39c38e8676481e2f4d5dad5439dd)` = 3` `}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | enum The status associated with a request to display a confirmation dialog.               |

|                                                                                                                                                     ### Typedefs                                                                                                                                                     ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AssetPackDownloadState](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaa635665bad061c34cbee483ada331afc) | typedef `struct AssetPackDownloadState_` An opaque struct used to access the state of an individual asset pack including download status and download size. |
| [AssetPackLocation](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga203c9740066102c3f4031379d1cb544e)      | typedef `struct AssetPackLocation_` An opaque struct used to access how and where an asset pack's assets are stored on the device.                          |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                    ### Functions                                                                                                                                                                                                                                                                                                                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AssetPackDownloadState_destroy](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaadd9df5d12e98d4e691f9cb8446a01af)`(`[AssetPackDownloadState](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaa635665bad061c34cbee483ada331afc)` *state)`                                          | `void` Releases the specified AssetPackDownloadState and any references it holds.                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [AssetPackDownloadState_getBytesDownloaded](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gae512408757fe4cbee306a587001e1665)`(`[AssetPackDownloadState](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaa635665bad061c34cbee483ada331afc)` *state)`                               | `uint64_t` Gets the total number of bytes already downloaded for the asset pack associated with the specified AssetPackDownloadState.                                                                                                                                                                                                                                                                                                                                                                                                  |
| [AssetPackDownloadState_getStatus](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaa45404b15cd45127c349ee1bafd3e94b)`(`[AssetPackDownloadState](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaa635665bad061c34cbee483ada331afc)` *state)`                                        | [AssetPackDownloadStatus](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga3cc7824aafc85614d5454355d996914c) Gets the AssetPackDownloadStatus for the specified AssetPackDownloadState.                                                                                                                                                                                                                                                                                                    |
| [AssetPackDownloadState_getTotalBytesToDownload](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga7d4fc697598271e2c092c66b40ed8b32)`(`[AssetPackDownloadState](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaa635665bad061c34cbee483ada331afc)` *state)`                          | `uint64_t` Gets the total size in bytes for the asset pack associated with the specified AssetPackDownloadState.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [AssetPackLocation_destroy](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga30165d853bd258d61c5fa9e9db50c364)`(`[AssetPackLocation](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga203c9740066102c3f4031379d1cb544e)` *location)`                                                 | `void` Releases the specified AssetPackLocation and any references it holds.                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [AssetPackLocation_getAssetsPath](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga350100908af9c3f5dcf29dd9db3bc504)`(`[AssetPackLocation](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga203c9740066102c3f4031379d1cb544e)` *location)`                                           | `const char *` Gets a file path to the directory containing the asset pack's unpackaged assets.                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [AssetPackLocation_getStorageMethod](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gad57d946650e83535ec552fa93168d186)`(`[AssetPackLocation](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga203c9740066102c3f4031379d1cb544e)` *location)`                                        | [AssetPackStorageMethod](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga7645ddff77635faf6b5f38f9ab0e69a0) Gets the AssetPackStorageMethod for the specified asset pack.                                                                                                                                                                                                                                                                                                                  |
| [AssetPackManager_cancelDownload](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga3bcec120912e3436f9265dcc451eb55f)`(const char **asset_packs, size_t num_asset_packs)`                                                                                                                                                         | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) Cancels downloading the specified asset packs.                                                                                                                                                                                                                                                                                                                                     |
| [AssetPackManager_destroy](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga2f11bb87a1224ebbd0565185b52afdb5)`()`                                                                                                                                                                                                                | `void` Frees up memory allocated for the Asset Pack API.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [AssetPackManager_getAssetPackLocation](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga56f2bd573bd9f03c3eae3b7e996fd9cd)`(const char *name, `[AssetPackLocation](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga203c9740066102c3f4031379d1cb544e)` **out_location)`              | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) Obtains an AssetPackLocation for the specified asset pack that can be used to query how and where the asset pack's assets are stored on the device.                                                                                                                                                                                                                                |
| [AssetPackManager_getDownloadState](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga588148959481fe0eba1d230e2abc40d3)`(const char *name, `[AssetPackDownloadState](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaa635665bad061c34cbee483ada331afc)` **out_state)`                | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) Gets the download state of the specified asset pack.                                                                                                                                                                                                                                                                                                                               |
| [AssetPackManager_getShowCellularDataConfirmationStatus](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga5fb44a80571b48606296d72454144b84)`(`[ShowCellularDataConfirmationStatus](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga5662eb2d02d8ead7f81fa0a4ae35ca61)` *out_status)` | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) **[Deprecated.](https://developer.android.com/reference/native/play/core/deprecated/deprecated)** Please use AssetPackManager_getShowConfirmationDialogStatus instead. Gets the status of[AssetPackManager_showCellularDataConfirmation()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gac195a784da4c735d56022d72c44fc903)requests. |
| [AssetPackManager_getShowConfirmationDialogStatus](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gafd5bb5299a9d6374cddea06e0b45700b)`(`[ShowConfirmationDialogStatus](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gad745b23323040cb1e285f49d8fb33848)` *out_status)`             | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) Gets the status of[AssetPackManager_showConfirmationDialog()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab98e27200dd195334b5d17efc04fd174)requests.                                                                                                                                                                              |
| [AssetPackManager_init](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga8b7412acad9d3f5fd9027aad79654288)`(JavaVM *jvm, jobject android_context)`                                                                                                                                                                               | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) Initialize the Asset Pack API, making the other functions available to call.                                                                                                                                                                                                                                                                                                       |
| [AssetPackManager_onPause](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga17bbcc6adfa3962f878018309474d7b2)`()`                                                                                                                                                                                                                | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) Deregisters an internal state update listener.                                                                                                                                                                                                                                                                                                                                     |
| [AssetPackManager_onResume](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga48a278f63807769205383dde06092596)`()`                                                                                                                                                                                                               | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) Registers an internal state update listener.                                                                                                                                                                                                                                                                                                                                       |
| [AssetPackManager_requestDownload](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gafcdb7a4d9daa1ad59c77c26e0f488518)`(const char **asset_packs, size_t num_asset_packs)`                                                                                                                                                        | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) Asynchronously requests to start downloading the specified asset packs.                                                                                                                                                                                                                                                                                                            |
| [AssetPackManager_requestInfo](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaea94cf5610966a98ae8eb12d33775882)`(const char **asset_packs, size_t num_asset_packs)`                                                                                                                                                            | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) Asynchronously requests download info about the specified asset packs.                                                                                                                                                                                                                                                                                                             |
| [AssetPackManager_requestRemoval](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga5edf60b262fd0cd397ad9da1a4215d7a)`(const char *name)`                                                                                                                                                                                         | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) Asynchronously requests to delete the specified asset pack from internal storage.                                                                                                                                                                                                                                                                                                  |
| [AssetPackManager_showCellularDataConfirmation](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gac195a784da4c735d56022d72c44fc903)`(jobject android_activity)`                                                                                                                                                                   | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) **[Deprecated.](https://developer.android.com/reference/native/play/core/deprecated/deprecated)** Please use AssetPackManager_showConfirmationDialog instead. Shows a confirmation dialog to resume all asset pack downloads that are currently in the ASSET_PACK_WAITING_FOR_WIFI state.                                                                                          |
| [AssetPackManager_showConfirmationDialog](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab98e27200dd195334b5d17efc04fd174)`(jobject android_activity)`                                                                                                                                                                         | [AssetPackErrorCode](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab72339a7d36069c9bcd9dbc4059bb03e) Shows a confirmation dialog to start all asset pack downloads that are currently in either the ASSET_PACK_REQUIRES_USER_CONFIRMATION state or the ASSET_PACK_WAITING_FOR_WIFI state.                                                                                                                                                                                               |

## Enumerations

### AssetPackDownloadStatus

```gdscript
 AssetPackDownloadStatus
```  
The status associated with asset pack download operations.

|                                                                                                                                                                                                                         Properties                                                                                                                                                                                                                          ||
|-----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ASSET_PACK_DOWNLOADING`                | The asset pack download is in progress.                                                                                                                                                                                                                                                                                                                                                                            |
| `ASSET_PACK_DOWNLOAD_CANCELED`          | Asset pack download has been canceled.                                                                                                                                                                                                                                                                                                                                                                             |
| `ASSET_PACK_DOWNLOAD_COMPLETED`         | Download and transfer are complete; the assets are available to the app.                                                                                                                                                                                                                                                                                                                                           |
| `ASSET_PACK_DOWNLOAD_FAILED`            | An[AssetPackManager_requestDownload()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gafcdb7a4d9daa1ad59c77c26e0f488518)has failed. AssetPackErrorCode will be the corresponding error, never ASSET_PACK_NO_ERROR. The bytes_downloaded and total_bytes_to_download fields are unreliable given this status.                                                          |
| `ASSET_PACK_DOWNLOAD_PENDING`           | An[AssetPackManager_requestDownload()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gafcdb7a4d9daa1ad59c77c26e0f488518)async request is pending.                                                                                                                                                                                                                     |
| `ASSET_PACK_INFO_FAILED`                | An[AssetPackManager_requestInfo()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaea94cf5610966a98ae8eb12d33775882)async request has failed. AssetPackErrorCode will be the corresponding error, never ASSET_PACK_NO_ERROR. The bytes_downloaded and total_bytes_to_download fields are unreliable given this status.                                                |
| `ASSET_PACK_INFO_PENDING`               | An[AssetPackManager_requestInfo()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaea94cf5610966a98ae8eb12d33775882)async request started, but the result isn't known yet.                                                                                                                                                                                            |
| `ASSET_PACK_NOT_INSTALLED`              | The asset pack isn't installed.                                                                                                                                                                                                                                                                                                                                                                                    |
| `ASSET_PACK_REMOVAL_FAILED`             | An[AssetPackManager_requestRemoval()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga5edf60b262fd0cd397ad9da1a4215d7a)async request has failed.                                                                                                                                                                                                                      |
| `ASSET_PACK_REMOVAL_PENDING`            | An[AssetPackManager_requestRemoval()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga5edf60b262fd0cd397ad9da1a4215d7a)async request started.                                                                                                                                                                                                                         |
| `ASSET_PACK_REQUIRES_USER_CONFIRMATION` | The asset pack download is waiting for user confirmation to proceed. Call[AssetPackManager_showConfirmationDialog()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab98e27200dd195334b5d17efc04fd174)to ask the user for consent.                                                                                                                                    |
| `ASSET_PACK_TRANSFERRING`               | The asset pack is being transferred to the app.                                                                                                                                                                                                                                                                                                                                                                    |
| `ASSET_PACK_UNKNOWN`                    | Nothing is known about the asset pack. Call[AssetPackManager_requestInfo()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaea94cf5610966a98ae8eb12d33775882)to check its size or[AssetPackManager_requestDownload()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gafcdb7a4d9daa1ad59c77c26e0f488518)start a download. |
| `ASSET_PACK_WAITING_FOR_WIFI`           | The asset pack download is waiting for Wi-Fi to proceed. Optionally, call[AssetPackManager_showConfirmationDialog()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab98e27200dd195334b5d17efc04fd174)to ask the user to confirm downloading over cellular data.                                                                                                      |

### AssetPackErrorCode

```text
 AssetPackErrorCode
```  
An error code associated with asset pack operations.

|                                                                                                                                                                                       Properties                                                                                                                                                                                        ||
|----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ASSET_PACK_ACCESS_DENIED`             | Download isn't permitted under current device circumstances, for example the app is running in the background or the device isn't signed into a Google account.                                                                                                                                                                                 |
| `ASSET_PACK_API_NOT_AVAILABLE`         | The Asset Pack API is unavailable.                                                                                                                                                                                                                                                                                                              |
| `ASSET_PACK_APP_NOT_OWNED`             | The app isn't owned by any user on this device. An app is "owned" if it has been acquired from the Play Store.                                                                                                                                                                                                                                  |
| `ASSET_PACK_APP_UNAVAILABLE`           | The requesting app is unavailable. This could be caused by multiple reasons: - The app isn't published in the Play Store. - The app version code isn't published in the Play Store. Note: an older version may exist. - The app is only available on a testing track that the user doesn't have access to, for example internal testing. <br /> |
| `ASSET_PACK_CONFIRMATION_NOT_REQUIRED` | Returned if showConfirmationDialog is called but no asset packs are waiting for user confirmation.                                                                                                                                                                                                                                              |
| `ASSET_PACK_DOWNLOAD_NOT_FOUND`        | The requested download isn't found.                                                                                                                                                                                                                                                                                                             |
| `ASSET_PACK_INITIALIZATION_FAILED`     | There was an error initializing the Asset Pack API.                                                                                                                                                                                                                                                                                             |
| `ASSET_PACK_INITIALIZATION_NEEDED`     | The requested operation failed: need to call[AssetPackManager_init()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga8b7412acad9d3f5fd9027aad79654288)first.                                                                                                                                      |
| `ASSET_PACK_INSUFFICIENT_STORAGE`      | Asset packs download failed due to insufficient storage.                                                                                                                                                                                                                                                                                        |
| `ASSET_PACK_INTERNAL_ERROR`            | Unknown error downloading asset pack.                                                                                                                                                                                                                                                                                                           |
| `ASSET_PACK_INVALID_REQUEST`           | The request is invalid.                                                                                                                                                                                                                                                                                                                         |
| `ASSET_PACK_NETWORK_ERROR`             | Network error. Unable to obtain asset pack details.                                                                                                                                                                                                                                                                                             |
| `ASSET_PACK_NETWORK_UNRESTRICTED`      | Returned if showCellularDataConfirmation is called but no asset packs are waiting for Wi-Fi.                                                                                                                                                                                                                                                    |
| `ASSET_PACK_PLAY_STORE_NOT_FOUND`      | The Play Store app is either not installed or not the official version.                                                                                                                                                                                                                                                                         |
| `ASSET_PACK_UNAVAILABLE`               | The requested asset pack isn't available for this app version. This can happen if the asset pack wasn't included in the Android App Bundle that was published to the Play Store.                                                                                                                                                                |
| `ASSET_PACK_UNRECOGNIZED_INSTALLATION` | Returned if the app was not installed by Play.                                                                                                                                                                                                                                                                                                  |

### AssetPackStorageMethod

```text
 AssetPackStorageMethod
```  
The method used to store an asset pack on the device.

|                                                                           Properties                                                                           ||
|------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| `ASSET_PACK_STORAGE_APK`           | The asset pack is installed as an APK containing packed asset files. Assets can be accessed via AssetManager.              |
| `ASSET_PACK_STORAGE_FILES`         | The asset pack is unpacked into a folder containing individual asset files. Assets can be accessed via standard File APIs. |
| `ASSET_PACK_STORAGE_NOT_INSTALLED` | The asset pack isn't installed.                                                                                            |
| `ASSET_PACK_STORAGE_UNKNOWN`       | Nothing is known, perhaps due to an error.                                                                                 |

### ShowCellularDataConfirmationStatus

```text
 ShowCellularDataConfirmationStatus
```  
The status associated with a request to display a cellular data confirmation dialog.

|                                                                                                                               Properties                                                                                                                                ||
|------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ASSET_PACK_CONFIRM_PENDING`       | [AssetPackManager_showCellularDataConfirmation()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gac195a784da4c735d56022d72c44fc903)has been called, but the user hasn't made a choice. |
| `ASSET_PACK_CONFIRM_UNKNOWN`       | [AssetPackManager_showCellularDataConfirmation()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gac195a784da4c735d56022d72c44fc903)has not been called.                                |
| `ASSET_PACK_CONFIRM_USER_APPROVED` | The user approved of downloading asset packs over cellular data.                                                                                                                                                                    |
| `ASSET_PACK_CONFIRM_USER_CANCELED` | The user declined to download asset packs over cellular data.                                                                                                                                                                       |

### ShowConfirmationDialogStatus

```text
 ShowConfirmationDialogStatus
```  
The status associated with a request to display a confirmation dialog.

|                                                                                                                                Properties                                                                                                                                ||
|-------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `ASSET_PACK_CONFIRMATION_DIALOG_APPROVED` | The user approved of downloading asset packs.                                                                                                                                                                                 |
| `ASSET_PACK_CONFIRMATION_DIALOG_CANCELED` | The user declined to download asset packs.                                                                                                                                                                                    |
| `ASSET_PACK_CONFIRMATION_DIALOG_PENDING`  | [AssetPackManager_showConfirmationDialog()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab98e27200dd195334b5d17efc04fd174)has been called, but the user hasn't made a choice. |
| `ASSET_PACK_CONFIRMATION_DIALOG_UNKNOWN`  | [AssetPackManager_showConfirmationDialog()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab98e27200dd195334b5d17efc04fd174)has not been called.                                |

## Typedefs

### AssetPackDownloadState

```gdscript
struct AssetPackDownloadState_ AssetPackDownloadState
```  
An opaque struct used to access the state of an individual asset pack including download status and download size.  

### AssetPackLocation

```scdoc
struct AssetPackLocation_ AssetPackLocation
```  
An opaque struct used to access how and where an asset pack's assets are stored on the device.

## Functions

### AssetPackDownloadState_destroy

```gdscript
void AssetPackDownloadState_destroy(
  AssetPackDownloadState *state
)
```  
Releases the specified AssetPackDownloadState and any references it holds.

<br />

|                                    Details                                    ||
|------------|-------------------------------------------------------------------|
| Parameters | |---------|--------------------| | `state` | The state to free. | |

### AssetPackDownloadState_getBytesDownloaded

```gdscript
uint64_t AssetPackDownloadState_getBytesDownloaded(
  AssetPackDownloadState *state
)
```  
Gets the total number of bytes already downloaded for the asset pack associated with the specified AssetPackDownloadState.

<br />

|                                                              Details                                                               ||
|-------------|-----------------------------------------------------------------------------------------------------------------------|
| Parameters  | |---------|----------------------------------------------| | `state` | The state for which to get bytes downloaded. | |
| **Returns** | The total number of bytes already downloaded.                                                                         |

### AssetPackDownloadState_getStatus

```gdscript
AssetPackDownloadStatus AssetPackDownloadState_getStatus(
  AssetPackDownloadState *state
)
```  
Gets the AssetPackDownloadStatus for the specified AssetPackDownloadState.

<br />

|                                                    Details                                                     ||
|-------------|---------------------------------------------------------------------------------------------------|
| Parameters  | |---------|------------------------------------| | `state` | The state for which to get status. | |
| **Returns** | The AssetPackDownloadStatus.                                                                      |

### AssetPackDownloadState_getTotalBytesToDownload

```gdscript
uint64_t AssetPackDownloadState_getTotalBytesToDownload(
  AssetPackDownloadState *state
)
```  
Gets the total size in bytes for the asset pack associated with the specified AssetPackDownloadState.

<br />

|                                                                     Details                                                                      ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |---------|-----------------------------------------------------| | `state` | The state for which to get total bytes to download. | |
| **Returns** | The total size in bytes for the asset pack.                                                                                         |

### AssetPackLocation_destroy

```scdoc
void AssetPackLocation_destroy(
  AssetPackLocation *location
)
```  
Releases the specified AssetPackLocation and any references it holds.

<br />

|                                          Details                                          ||
|------------|-------------------------------------------------------------------------------|
| Parameters | |------------|-----------------------| | `location` | The location to free. | |

### AssetPackLocation_getAssetsPath

```gdscript
const char * AssetPackLocation_getAssetsPath(
  AssetPackLocation *location
)
```  
Gets a file path to the directory containing the asset pack's unpackaged assets.

The files found in this path should not be modified.

The string returned here is owned by the AssetPackManager implementation and will be freed by calling[AssetPackLocation_destroy()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga30165d853bd258d61c5fa9e9db50c364).

|                                                                                                Details                                                                                                 ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |------------|----------------------------------------------------| | `location` | The location from which to obtain the assets path. |                                                   |
| **Returns** | A file path to the directory containing the asset pack's unpackaged assets, provided that the asset pack's storage method is ASSET_PACK_STORAGE_FILES. Otherwise, returns a null pointer. |

### AssetPackLocation_getStorageMethod

```scdoc
AssetPackStorageMethod AssetPackLocation_getStorageMethod(
  AssetPackLocation *location
)
```  
Gets the AssetPackStorageMethod for the specified asset pack.

<br />

|                                                                    Details                                                                     ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |------------|-------------------------------------------------| | `location` | The location for which to get a storage method. | |
| **Returns** | The AssetPackStorageMethod for the specified asset pack.                                                                          |

### AssetPackManager_cancelDownload

```gdscript
AssetPackErrorCode AssetPackManager_cancelDownload(
  const char **asset_packs,
  size_t num_asset_packs
)
```  
Cancels downloading the specified asset packs.

Note: Only active downloads will be canceled. Asset packs with a status of ASSET_PACK_DOWNLOAD_COMPLETED or ASSET_PACK_NOT_INSTALLED are unaffected by this method.

|                                                                                               Details                                                                                               ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |-------------------|--------------------------------------| | `asset_packs`     | An array of asset pack names.        | | `num_asset_packs` | The length of the asset_packs array. | |
| **Returns** | Always ASSET_PACK_NO_ERROR, except in the case of an invalid call such as ASSET_PACK_INITIALIZATION_NEEDED or ASSET_PACK_INVALID_REQUEST.                                              |

### AssetPackManager_destroy

```scdoc
void AssetPackManager_destroy()
```  
Frees up memory allocated for the Asset Pack API.

Does nothing if[AssetPackManager_init()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga8b7412acad9d3f5fd9027aad79654288)hasn't been called.  

### AssetPackManager_getAssetPackLocation

```gdscript
AssetPackErrorCode AssetPackManager_getAssetPackLocation(
  const char *name,
  AssetPackLocation **out_location
)
```  
Obtains an AssetPackLocation for the specified asset pack that can be used to query how and where the asset pack's assets are stored on the device.

**See also:** [AssetPackLocation_destroy](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga30165d853bd258d61c5fa9e9db50c364)

|                                                                                                   Details                                                                                                    ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |----------------|--------------------------------------------| | `name`         | An asset pack name.                        | | `out_location` | An out parameter for receiving the result. | |
| **Returns** | An AssetPackErrorCode, which if not ASSET_PACK_NO_ERROR indicates that the out parameter shouldn't be used.                                                                                     |

### AssetPackManager_getDownloadState

```gdscript
AssetPackErrorCode AssetPackManager_getDownloadState(
  const char *name,
  AssetPackDownloadState **out_state
)
```  
Gets the download state of the specified asset pack.

The last known error code is returned directly, whereas other state can be obtained via the AssetPackDownloadState out parameter by using functions such as[AssetPackDownloadState_getStatus()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaa45404b15cd45127c349ee1bafd3e94b).

This function can be used to monitor progress or get the final result of a call to[AssetPackManager_requestInfo()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaea94cf5610966a98ae8eb12d33775882),[AssetPackManager_requestDownload()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gafcdb7a4d9daa1ad59c77c26e0f488518), or[AssetPackManager_requestRemoval()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga5edf60b262fd0cd397ad9da1a4215d7a). This method does not make any JNI calls and can be called every frame.**See also:** [AssetPackDownloadState_destroy](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gaadd9df5d12e98d4e691f9cb8446a01af)

|                                                                                               Details                                                                                               ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |-------------|--------------------------------------------| | `name`      | An asset pack name.                        | | `out_state` | An out parameter for receiving the result. | |
| **Returns** | ASSET_PACK_NO_ERROR if the request started successfully.                                                                                                                               |

### AssetPackManager_getShowCellularDataConfirmationStatus

```scdoc
AssetPackErrorCode AssetPackManager_getShowCellularDataConfirmationStatus(
  ShowCellularDataConfirmationStatus *out_status
)
```  
Gets the status of[AssetPackManager_showCellularDataConfirmation()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gac195a784da4c735d56022d72c44fc903)requests.

This function does not make any JNI calls and can be called every frame.**[Deprecated.](https://developer.android.com/reference/native/play/core/deprecated/deprecated)**Please use AssetPackManager_getShowConfirmationDialogStatus instead.

|                                                                 Details                                                                  ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------------|--------------------------------------------| | `out_status` | An out parameter for receiving the result. | |
| **Returns** | An AssetPackErrorCode, which if not ASSET_PACK_NO_ERROR indicates that the out parameter should not be used.                |

### AssetPackManager_getShowConfirmationDialogStatus

```scdoc
AssetPackErrorCode AssetPackManager_getShowConfirmationDialogStatus(
  ShowConfirmationDialogStatus *out_status
)
```  
Gets the status of[AssetPackManager_showConfirmationDialog()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gab98e27200dd195334b5d17efc04fd174)requests.

This function does not make any JNI calls and can be called every frame.

|                                                                 Details                                                                  ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------------|--------------------------------------------| | `out_status` | An out parameter for receiving the result. | |
| **Returns** | An AssetPackErrorCode, which if not ASSET_PACK_NO_ERROR indicates that the out parameter should not be used.                |

### AssetPackManager_init

```scdoc
AssetPackErrorCode AssetPackManager_init(
  JavaVM *jvm,
  jobject android_context
)
```  
Initialize the Asset Pack API, making the other functions available to call.

In case of failure the Asset Pack API is unavailable, and there will be an error in logcat. The most common reason for failure is that the PlayCore AAR is missing or some of its classes/methods weren't retained by ProGuard.**See also:** [AssetPackManager_destroy](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga2f11bb87a1224ebbd0565185b52afdb5)

|                                                                                                                                                   Details                                                                                                                                                    ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |-------------------|-------------------------------------------------------------------------| | `jvm`             | The app's single JavaVM, for example from ANativeActivity's "vm" field. | | `android_context` | An Android Context, for example from ANativeActivity's "clazz" field.   | |
| **Returns** | ASSET_PACK_NO_ERROR if initialization succeeded.                                                                                                                                                                                                                                                |

### AssetPackManager_onPause

```scdoc
AssetPackErrorCode AssetPackManager_onPause()
```  
Deregisters an internal state update listener.

Must be called in ANativeActivity ANativeActivityCallbacks's onPause, or equivalent.

|                                   Details                                   ||
|-------------|----------------------------------------------------------------|
| **Returns** | ASSET_PACK_NO_ERROR if the call succeeded, or an error if not. |

### AssetPackManager_onResume

```scdoc
AssetPackErrorCode AssetPackManager_onResume()
```  
Registers an internal state update listener.

Must be called in ANativeActivity ANativeActivityCallbacks's onResume, or equivalent.

|                                   Details                                   ||
|-------------|----------------------------------------------------------------|
| **Returns** | ASSET_PACK_NO_ERROR if the call succeeded, or an error if not. |

### AssetPackManager_requestDownload

```gdscript
AssetPackErrorCode AssetPackManager_requestDownload(
  const char **asset_packs,
  size_t num_asset_packs
)
```  
Asynchronously requests to start downloading the specified asset packs.

Use[AssetPackManager_getDownloadState()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga588148959481fe0eba1d230e2abc40d3)to monitor download progress. This request will fail if the app isn't in the foreground.

|                                                                                               Details                                                                                               ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |-------------------|--------------------------------------| | `asset_packs`     | An array of asset pack names.        | | `num_asset_packs` | The length of the asset_packs array. | |
| **Returns** | ASSET_PACK_NO_ERROR if the request started successfully.                                                                                                                               |

### AssetPackManager_requestInfo

```gdscript
AssetPackErrorCode AssetPackManager_requestInfo(
  const char **asset_packs,
  size_t num_asset_packs
)
```  
Asynchronously requests download info about the specified asset packs.

Use[AssetPackManager_getDownloadState()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga588148959481fe0eba1d230e2abc40d3)to monitor progress and get the result.

|                                                                                               Details                                                                                               ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |-------------------|--------------------------------------| | `asset_packs`     | An array of asset pack names.        | | `num_asset_packs` | The length of the asset_packs array. | |
| **Returns** | ASSET_PACK_NO_ERROR if the request started successfully.                                                                                                                               |

### AssetPackManager_requestRemoval

```gdscript
AssetPackErrorCode AssetPackManager_requestRemoval(
  const char *name
)
```  
Asynchronously requests to delete the specified asset pack from internal storage.

Use[AssetPackManager_getDownloadState()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga588148959481fe0eba1d230e2abc40d3)to check deletion progress.

Use this function to delete asset packs instead of deleting the files manually. This ensures that the asset pack won't be re-downloaded during an app update.

If the asset pack is currently being downloaded or installed, this function won't cancel that operation.

|                                    Details                                     ||
|-------------|-------------------------------------------------------------------|
| Parameters  | |--------|---------------------| | `name` | An asset pack name. | |
| **Returns** | ASSET_PACK_NO_ERROR if the request started successfully.          |

### AssetPackManager_showCellularDataConfirmation

```scdoc
AssetPackErrorCode AssetPackManager_showCellularDataConfirmation(
  jobject android_activity
)
```  
Shows a confirmation dialog to resume all asset pack downloads that are currently in the ASSET_PACK_WAITING_FOR_WIFI state.

If the user agrees to the dialog prompt, asset packs are downloaded over cellular data. The status of an asset pack is set to ASSET_PACK_WAITING_FOR_WIFI if the user is currently not on a Wi-Fi connection and the asset pack is large or the user has set their download preference in the Play Store to only download apps over Wi-Fi. By showing this dialog, your app can ask the user if they accept downloading the asset pack over cellular data instead of waiting for Wi-Fi.**[Deprecated.](https://developer.android.com/reference/native/play/core/deprecated/deprecated)**Please use AssetPackManager_showConfirmationDialog instead.

|                                                                                                                                     Details                                                                                                                                     ||
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------------------|------------------------------------------------------------------------| | `android_activity` | An Android Activity, for example from ANativeActivity's "clazz" field. |                                                                    |
| **Returns** | ASSET_PACK_NO_ERROR if the dialog is shown. Call[AssetPackManager_getShowCellularDataConfirmationStatus()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1ga5fb44a80571b48606296d72454144b84)to get the dialog result. |

### AssetPackManager_showConfirmationDialog

```scdoc
AssetPackErrorCode AssetPackManager_showConfirmationDialog(
  jobject android_activity
)
```  
Shows a confirmation dialog to start all asset pack downloads that are currently in either the ASSET_PACK_REQUIRES_USER_CONFIRMATION state or the ASSET_PACK_WAITING_FOR_WIFI state.

The status of an asset pack is set to ASSET_PACK_REQUIRES_USER_CONFIRMATION if the download cannot proceed without user consent. By showing this dialog, your app can ask the user for consent to download the asset pack from Google Play. If the app has not been installed by Play, an update may be triggered to ensure that a valid version is installed. This will cause the app to restart and all asset requests to be cancelled. These assets should be requested again after the app restarts.

The status of an asset pack is set to ASSET_PACK_WAITING_FOR_WIFI if the user is currently not on a Wi-Fi connection and the asset pack is large or the user has set their download preference in the Play Store to only download apps over Wi-Fi. By showing this dialog, your app can ask the user if they accept downloading the asset pack over cellular data instead of waiting for Wi-Fi.

<br />

|                                                                                                                                  Details                                                                                                                                  ||
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Parameters  | |--------------------|------------------------------------------------------------------------| | `android_activity` | An Android Activity, for example from ANativeActivity's "clazz" field. |                                                              |
| **Returns** | ASSET_PACK_NO_ERROR if the dialog is shown. Call[AssetPackManager_getShowConfirmationDialogStatus()](https://developer.android.com/reference/native/play/core/group/assetpack#group__assetpack_1gafd5bb5299a9d6374cddea06e0b45700b)to get the dialog result. |