Stay organized with collections
Save and categorize content based on your preferences.
AssetPackLocation
public
abstract
class
AssetPackLocation
extends Object
Location of an asset pack on the device.
A pack can be:
- either extracted into a folder on the device
- or installed as an APK
If the pack is stored as a folder, individual assets can be accessed as standard files on the
filesystem.
If the pack is installed as an APK:
Summary
Inherited methods |
From class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
AssetPackLocation
public AssetPackLocation ()
Public methods
assetsPath
public abstract String assetsPath ()
Returns the file path to the folder containing the pack's assets, if the storage method is
AssetPackStorageMethod.STORAGE_FILES
.
The files found at this path should not be modified.
If the storage method is AssetPackStorageMethod.APK_ASSETS
, this method will return
null
. To access assets from packs installed as APKs, use Asset Manager.
packStorageMethod
public abstract int packStorageMethod ()
Returns whether the pack is installed as an APK or extracted into a folder on the filesystem.
path
public abstract String path ()
Returns the file path to the folder containing the extracted asset pack, if the storage method
is AssetPackStorageMethod.STORAGE_FILES
.
The files found at this path should not be modified.
If the storage method is AssetPackStorageMethod.APK_ASSETS
, this method will return
null
. To access assets from packs installed as APKs, use Asset Manager.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# AssetPackLocation\n\nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nAssetPackLocation\n=================\n\n\n`\npublic\n\n\nabstract\nclass\nAssetPackLocation\n`\n\n\n`\n\nextends `[Object](https://developer.android.com/reference/java/lang/Object.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|-----------------------------------------------------------|\n| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||\n| ↳ | com.google.android.play.core.assetpacks.AssetPackLocation |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nLocation of an asset pack on the device.\n\nA pack can be:\n\n- either extracted into a folder on the device\n- or installed as an APK\n\nIf the pack is stored as a folder, individual assets can be accessed as standard files on the\nfilesystem.\n\nIf the pack is installed as an APK:\n\n- common case: you can access assets via Android's AssetManager API\n- advanced use-cases: you can use [AssetPackManager.getAssetLocation(String, String)](../../../../../../../reference/com/google/android/play/core/assetpacks/AssetPackManager.html#getAssetLocation(java.lang.String,%20java.lang.String)), which returns the location of an asset inside the corresponding APK file\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[AssetPackLocation](../../../../../../../reference/com/google/android/play/core/assetpacks/AssetPackLocation.html#AssetPackLocation())`() ` |\n\n| ### Public methods ||\n|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[String](https://developer.android.com/reference/java/lang/String.html) | ` `[assetsPath](../../../../../../../reference/com/google/android/play/core/assetpacks/AssetPackLocation.html#assetsPath())`() ` Returns the file path to the folder containing the pack's assets, if the storage method is [AssetPackStorageMethod.STORAGE_FILES](../../../../../../../reference/com/google/android/play/core/assetpacks/model/AssetPackStorageMethod.html#STORAGE_FILES). |\n| ` abstract int` | ` `[packStorageMethod](../../../../../../../reference/com/google/android/play/core/assetpacks/AssetPackLocation.html#packStorageMethod())`() ` Returns whether the pack is installed as an APK or extracted into a folder on the filesystem. |\n| ` abstract `[String](https://developer.android.com/reference/java/lang/String.html) | ` `[path](../../../../../../../reference/com/google/android/play/core/assetpacks/AssetPackLocation.html#path())`() ` Returns the file path to the folder containing the extracted asset pack, if the storage method is [AssetPackStorageMethod.STORAGE_FILES](../../../../../../../reference/com/google/android/play/core/assetpacks/model/AssetPackStorageMethod.html#STORAGE_FILES). |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` boolean` | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` `[String](https://developer.android.com/reference/java/lang/String.html) | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic constructors\n-------------------\n\n### AssetPackLocation\n\n```\npublic AssetPackLocation ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### assetsPath\n\n```\npublic abstract String assetsPath ()\n```\n\nReturns the file path to the folder containing the pack's assets, if the storage method is\n[AssetPackStorageMethod.STORAGE_FILES](../../../../../../../reference/com/google/android/play/core/assetpacks/model/AssetPackStorageMethod.html#STORAGE_FILES).\n\nThe files found at this path should not be modified.\n\nIf the storage method is [AssetPackStorageMethod.APK_ASSETS](../../../../../../../reference/com/google/android/play/core/assetpacks/model/AssetPackStorageMethod.html#APK_ASSETS), this method will return\n`null`. To access assets from packs installed as APKs, use Asset Manager.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------|--------|\n| [String](https://developer.android.com/reference/java/lang/String.html) | \u003cbr /\u003e |\n\n### packStorageMethod\n\n```\npublic abstract int packStorageMethod ()\n```\n\nReturns whether the pack is installed as an APK or extracted into a folder on the filesystem.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | a value from [AssetPackStorageMethod](../../../../../../../reference/com/google/android/play/core/assetpacks/model/AssetPackStorageMethod.html) \u003cbr /\u003e |\n\n### path\n\n```\npublic abstract String path ()\n```\n\nReturns the file path to the folder containing the extracted asset pack, if the storage method\nis [AssetPackStorageMethod.STORAGE_FILES](../../../../../../../reference/com/google/android/play/core/assetpacks/model/AssetPackStorageMethod.html#STORAGE_FILES).\n\nThe files found at this path should not be modified.\n\nIf the storage method is [AssetPackStorageMethod.APK_ASSETS](../../../../../../../reference/com/google/android/play/core/assetpacks/model/AssetPackStorageMethod.html#APK_ASSETS), this method will return\n`null`. To access assets from packs installed as APKs, use Asset Manager.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------------------------------|--------|\n| [String](https://developer.android.com/reference/java/lang/String.html) | \u003cbr /\u003e |"]]