Join us for ⁠#Android11: The Beta Launch Show on June 3!

AssetPackState

public abstract class AssetPackState
extends Object

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


The state of an individual asset pack.

Summary

Public constructors

AssetPackState()

Public methods

abstract long bytesDownloaded()

Returns the total number of bytes already downloaded for the pack.

abstract int errorCode()

Returns the error code for the pack, if Play has failed to download the pack.

abstract String name()

Returns the name of the pack.

abstract int status()

Returns the download status of the pack.

abstract long totalBytesToDownload()

Returns the total size of the pack in bytes.

abstract int transferProgressPercentage()

Returns the percentage of the asset pack already transferred to the app.

Inherited methods

From class java.lang.Object

Public constructors

AssetPackState

AssetPackState ()

Public methods

bytesDownloaded

long bytesDownloaded ()

Returns the total number of bytes already downloaded for the pack.

Returns
long

errorCode

int errorCode ()

Returns the error code for the pack, if Play has failed to download the pack. Returns NO_ERROR if the download was successful or is in progress or has not been attempted.

Returns
int A value from AssetPackErrorCode.

name

String name ()

Returns the name of the pack.

Returns
String

status

int status ()

Returns the download status of the pack.

If the pack has never been requested before its status is UNKNOWN.

Returns
int A value from AssetPackStatus.

totalBytesToDownload

long totalBytesToDownload ()

Returns the total size of the pack in bytes.

Returns
long

transferProgressPercentage

int transferProgressPercentage ()

Returns the percentage of the asset pack already transferred to the app.

This value is only defined when the status is TRANSFERRING.

Returns
int a value between 0 and 100 inclusive.