The second Android 11 Developer Preview is now available, test it out and share your feedback.

InstallState

public abstract class InstallState
extends Object

java.lang.Object
   ↳ com.google.android.play.core.install.InstallState


Reports the request state of a module install or update.

To see examples, read Install a flexible update.

Summary

Public constructors

InstallState()

Public methods

abstract long bytesDownloaded()

Returns the number of bytes downloaded so far.

abstract int installErrorCode()

Returns the error code for an install, or NO_ERROR if the install is successful or in progress.

abstract int installStatus()

Returns the status of an install.

abstract String packageName()

Returns the package name for the app being installed.

abstract long totalBytesToDownload()

Returns the total number of bytes to be downloaded for this update.

Inherited methods

From class java.lang.Object

Public constructors

InstallState

InstallState ()

Public methods

bytesDownloaded

long bytesDownloaded ()

Returns the number of bytes downloaded so far.

The return value is defined only if installStatus() returns DOWNLOADING.

Returns
long

installErrorCode

int installErrorCode ()

Returns the error code for an install, or NO_ERROR if the install is successful or in progress.

Returns
int a value from InstallErrorCode

installStatus

int installStatus ()

Returns the status of an install.

To see examples, read Install a flexible update.

Returns
int a value from InstallStatus

packageName

String packageName ()

Returns the package name for the app being installed.

Returns
String

totalBytesToDownload

long totalBytesToDownload ()

Returns the total number of bytes to be downloaded for this update.

The return value is defined only if installStatus() returns DOWNLOADING.

Returns
long