AppUpdateInfo
public
abstract
class
AppUpdateInfo
extends Object
java.lang.Object | |
↳ | com.google.android.play.core.appupdate.AppUpdateInfo |
Contains information about the avilability and progress of an app update.
To learn more, see support in-app updates.
Summary
Public constructors | |
---|---|
AppUpdateInfo()
|
Public methods | |
---|---|
abstract
int
|
availableVersionCode()
If an update is available or in progress, this method returns the version code of the update. |
abstract
long
|
bytesDownloaded()
Returns the number of bytes downloaded so far. |
abstract
Integer
|
clientVersionStalenessDays()
If an update is available or in progress, this method returns the number of days since the Google Play Store app on the user's device has learnt about an available update. |
abstract
int
|
installStatus()
Returns the progress status of the update. |
boolean
|
isUpdateTypeAllowed(AppUpdateOptions appUpdateOptions)
Returns whether an update with the provided options is allowed. |
boolean
|
isUpdateTypeAllowed(int updateType)
Returns whether the desired update type, such as flexible or immediate, is allowed. |
abstract
String
|
packageName()
Returns the package name for the app to be updated. |
abstract
long
|
totalBytesToDownload()
Returns the total number of bytes to be downloaded for this update. |
abstract
int
|
updateAvailability()
Returns whether an update is available for the app. |
abstract
int
|
updatePriority()
Returns the in-app update priority for this update, as defined by the developer in the Google Play Developer API. |
Inherited methods | |
---|---|
Public constructors
AppUpdateInfo
public AppUpdateInfo ()
Public methods
availableVersionCode
public abstract int availableVersionCode ()
If an update is available or in progress, this method returns the version code of the update.
If no updates are available, this method returns an arbitrary value.
Returns | |
---|---|
int |
bytesDownloaded
public abstract long bytesDownloaded ()
Returns the number of bytes downloaded so far.
The return value is defined only if installStatus()
returns InstallStatus.DOWNLOADING
.
Returns | |
---|---|
long |
clientVersionStalenessDays
public abstract Integer clientVersionStalenessDays ()
If an update is available or in progress, this method returns the number of days since the Google Play Store app on the user's device has learnt about an available update.
If update is not available, or if staleness information is unavailable, this method returns
null
.
Returns | |
---|---|
Integer |
installStatus
public abstract int installStatus ()
Returns the progress status of the update.
The return value is defined only if updateAvailability()
returns UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS
.
To see examples, go to Install a flexible update>.
Returns | |
---|---|
int |
a value from InstallStatus
|
isUpdateTypeAllowed
public boolean isUpdateTypeAllowed (AppUpdateOptions appUpdateOptions)
Returns whether an update with the provided options is allowed.
To learn more, read Check for update availability.
Parameters | |
---|---|
appUpdateOptions |
AppUpdateOptions |
Returns | |
---|---|
boolean |
isUpdateTypeAllowed
public boolean isUpdateTypeAllowed (int updateType)
Returns whether the desired update type, such as flexible or immediate, is allowed.
To learn more, read Check for update availability.
Parameters | |
---|---|
updateType |
int : a value from AppUpdateType
|
Returns | |
---|---|
boolean |
packageName
public abstract String packageName ()
Returns the package name for the app to be updated.
Returns | |
---|---|
String |
totalBytesToDownload
public abstract long totalBytesToDownload ()
Returns the total number of bytes to be downloaded for this update.
The return value is defined only if installStatus()
returns InstallStatus.DOWNLOADING
.
Returns | |
---|---|
long |
updateAvailability
public abstract int updateAvailability ()
Returns whether an update is available for the app.
To learn more, read Check for update availability.
Returns | |
---|---|
int |
a value from UpdateAvailability
|
updatePriority
public abstract int updatePriority ()
Returns the in-app update priority for this update, as defined by the developer in the Google Play Developer API.
You can define in-app update priority of a release by setting 'inAppUpdatePriority' field under Edits.tracks.releases.
The return value is defined only if updateAvailability()
returns UpdateAvailability.UPDATE_AVAILABLE
.
Returns | |
---|---|
int |