Google is committed to advancing racial equity for Black communities. See how.

AssetPackLocation

public abstract class AssetPackLocation
extends Object

java.lang.Object
   ↳ com.google.android.play.core.assetpacks.AssetPackLocation


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:

  • common case: you can access assets via Android's AssetManager API
  • advanced use-cases: you can use getAssetLocation(String, String), which returns the location of an asset inside the corresponding APK file

Summary

Public constructors

AssetPackLocation()

Public methods

abstract String assetsPath()

Returns the file path to the folder containing the pack's assets, if the storage method is STORAGE_FILES.

abstract int packStorageMethod()

Returns whether the pack is installed as an APK or extracted into a folder on the filesystem.

abstract String path()

Returns the file path to the folder containing the extracted asset pack, if the storage method is STORAGE_FILES.

Inherited methods

From class java.lang.Object

Public constructors

AssetPackLocation

AssetPackLocation ()

Public methods

assetsPath

String assetsPath ()

Returns the file path to the folder containing the pack's assets, if the storage method is STORAGE_FILES.

The files found at this path should not be modified.

If the storage method is APK_ASSETS, this method will return null. To access assets from packs installed as APKs, use Asset Manager.

Returns
String

packStorageMethod

int packStorageMethod ()

Returns whether the pack is installed as an APK or extracted into a folder on the filesystem.

Returns
int a value from AssetPackStorageMethod

path

String path ()

Returns the file path to the folder containing the extracted asset pack, if the storage method is STORAGE_FILES.

The files found at this path should not be modified.

If the storage method is APK_ASSETS, this method will return null. To access assets from packs installed as APKs, use Asset Manager.

Returns
String