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:

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 AssetPackStorageMethod.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 AssetPackStorageMethod.STORAGE_FILES.

Inherited methods

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.

Returns
String

packStorageMethod

public abstract 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

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.

Returns
String