PlayAssetPacks

Google Play Asset Delivery: on-demand asset packs hosted by Play. Each pack is an asset-pack module whose files sit under assets/<packId>/. A sideloaded build gets NeedsPlayConfirmation, never local files.

Constructors

Link copied to clipboard
constructor(context: ERROR CLASS: Symbol not found for Context, manager: AssetPackManager = AssetPackManagerFactory.getInstance(context))

Functions

Link copied to clipboard
open suspend override fun fetch(packId: String): PackState

Starts or resumes the download and suspends until the state isSettled. Cancelling cancels the download.

Link copied to clipboard
open suspend override fun readBytes(packId: String, path: String): ByteArray?

A file of a ready pack, or null when the pack is not ready or has no such file.

Link copied to clipboard
open suspend override fun remove(packId: String)

Frees the pack's space; the next fetch downloads it again.

Link copied to clipboard
open override fun state(packId: String): Flow<PackState>

The pack's state; the first value is read from the store, never assumed.