# AppUpdateInfo

Summary:[Methods](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo#inhmethods)  

# AppUpdateInfo

`
public


class
AppUpdateInfo
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object.html)`


``


`

|---|------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | com.google.android.play.core.appupdate.AppUpdateInfo |

<br />

*** ** * ** ***

Contains information about the avilability and progress of an app update.

To learn more, see[support in-app updates](https://d.android.com/guide/app-bundle/in-app-updates).

## Summary

|                                                                                                                                                                                                                                                                                                                                                               ### Public methods                                                                                                                                                                                                                                                                                                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`                                                                                                                                              | ` `[availableVersionCode](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#availableVersionCode())`() ` If an update is available or in progress, this method returns the version code of the update.                                                                                                                                                                                                                                                                                                                                    |
| ` long`                                                                                                                                             | ` `[bytesDownloaded](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#bytesDownloaded())`() ` Returns the number of bytes downloaded so far.                                                                                                                                                                                                                                                                                                                                                                                             |
| ` `[Integer](https://developer.android.com/reference/java/lang/Integer.html)                                                                        | ` `[clientVersionStalenessDays](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#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.                                                                                                                                                                                                                                          |
| ` `[Set](https://developer.android.com/reference/java/util/Set.html)`<`[Integer](https://developer.android.com/reference/java/lang/Integer.html)`>` | ` `[getFailedUpdatePreconditions](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#getFailedUpdatePreconditions(com.google.android.play.core.appupdate.AppUpdateOptions))`(`[AppUpdateOptions](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateOptions.html)` options) ` Returns a set of[UpdatePrecondition](https://developer.android.com/reference/com/google/android/play/core/install/model/UpdatePrecondition.html)s describing why an update flow is currently not allowed to be started. |
| ` int`                                                                                                                                              | ` `[installStatus](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#installStatus())`() ` Returns the progress status of the update.                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` boolean`                                                                                                                                          | ` `[isUpdateTypeAllowed](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#isUpdateTypeAllowed(com.google.android.play.core.appupdate.AppUpdateOptions))`(`[AppUpdateOptions](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateOptions.html)` appUpdateOptions) ` Returns whether an update with the provided options is allowed.                                                                                                                                                                  |
| ` boolean`                                                                                                                                          | ` `[isUpdateTypeAllowed](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#isUpdateTypeAllowed(int))`(int updateType) ` Returns whether the desired update type, such as*flexible* or*immediate*, is allowed.                                                                                                                                                                                                                                                                                                                             |
| ` `[String](https://developer.android.com/reference/java/lang/String.html)                                                                          | ` `[packageName](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#packageName())`() ` Returns the package name for the app to be updated.                                                                                                                                                                                                                                                                                                                                                                                                |
| ` long`                                                                                                                                             | ` `[totalBytesToDownload](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#totalBytesToDownload())`() ` Returns the total number of bytes to be downloaded for this update.                                                                                                                                                                                                                                                                                                                                                              |
| ` int`                                                                                                                                              | ` `[updateAvailability](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#updateAvailability())`() ` Returns whether an update is available for the app.                                                                                                                                                                                                                                                                                                                                                                                  |
| ` int`                                                                                                                                              | ` `[updatePriority](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#updatePriority())`() ` Returns the in-app update priority for this update, as defined by the developer in the Google Play Developer API.                                                                                                                                                                                                                                                                                                                            |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||

## Public methods

### availableVersionCode

```
public 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.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### bytesDownloaded

```
public long bytesDownloaded ()
```

Returns the number of bytes downloaded so far.

The return value is defined only if[installStatus()](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#installStatus())returns[InstallStatus.DOWNLOADING](https://developer.android.com/reference/com/google/android/play/core/install/model/InstallStatus.html#DOWNLOADING).

<br />

|    Returns     ||
|--------|--------|
| `long` | <br /> |

### clientVersionStalenessDays

```
public 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`.

<br />

|                                      Returns                                      ||
|---------------------------------------------------------------------------|--------|
| [Integer](https://developer.android.com/reference/java/lang/Integer.html) | <br /> |

### getFailedUpdatePreconditions

```
public Set<Integer> getFailedUpdatePreconditions (AppUpdateOptions options)
```

Returns a set of[UpdatePrecondition](https://developer.android.com/reference/com/google/android/play/core/install/model/UpdatePrecondition.html)s describing why an update flow is currently not allowed to be started.

Returns an empty set if no update is available or the update flow is allowed to be started.

<br />

|              Parameters              ||
|-----------|---------------------------|
| `options` | `AppUpdateOptions` <br /> |

|                                                                         Returns                                                                          ||
|--------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [Set](https://developer.android.com/reference/java/util/Set.html)`<`[Integer](https://developer.android.com/reference/java/lang/Integer.html)`>` | <br /> |

### installStatus

```
public int installStatus ()
```

Returns the progress status of the update.

The return value is defined only if[updateAvailability()](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#updateAvailability())returns[UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS](https://developer.android.com/reference/com/google/android/play/core/install/model/UpdateAvailability.html#DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS).

To see examples, go to[Install a flexible update](https://d.android.com/guide/app-bundle/in-app-updates#install_flexible).

<br />

|                                                                     Returns                                                                      ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | a value from[InstallStatus](https://developer.android.com/reference/com/google/android/play/core/install/model/InstallStatus.html) <br /> |

### isUpdateTypeAllowed

```
public boolean isUpdateTypeAllowed (AppUpdateOptions appUpdateOptions)
```

Returns whether an update with the provided options is allowed.

To learn more, read[Check for update availability](https://d.android.com/guide/app-bundle/in-app-updates#update_readiness).

<br />

|                  Parameters                   ||
|--------------------|---------------------------|
| `appUpdateOptions` | `AppUpdateOptions` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### 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](https://d.android.com/guide/app-bundle/in-app-updates#update_readiness).

<br />

|                                                                           Parameters                                                                           ||
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| `updateType` | `int`: a value from[AppUpdateType](https://developer.android.com/reference/com/google/android/play/core/install/model/AppUpdateType.html) <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### packageName

```
public String packageName ()
```

Returns the package name for the app to be updated.

<br />

|                                     Returns                                     ||
|-------------------------------------------------------------------------|--------|
| [String](https://developer.android.com/reference/java/lang/String.html) | <br /> |

### totalBytesToDownload

```
public long totalBytesToDownload ()
```

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

The return value is defined only if[installStatus()](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#installStatus())returns[InstallStatus.DOWNLOADING](https://developer.android.com/reference/com/google/android/play/core/install/model/InstallStatus.html#DOWNLOADING).

<br />

|    Returns     ||
|--------|--------|
| `long` | <br /> |

### updateAvailability

```
public int updateAvailability ()
```

Returns whether an update is available for the app.

To learn more, read[Check for update availability](https://d.android.com/guide/app-bundle/in-app-updates#update_readiness).

<br />

|                                                                          Returns                                                                           ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | a value from[UpdateAvailability](https://developer.android.com/reference/com/google/android/play/core/install/model/UpdateAvailability.html) <br /> |

### updatePriority

```
public 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.](https://developers.google.com/android-publisher/api-ref/edits/tracks)

The return value is defined only if[updateAvailability()](https://developer.android.com/reference/com/google/android/play/core/appupdate/AppUpdateInfo.html#updateAvailability())returns[UpdateAvailability.UPDATE_AVAILABLE](https://developer.android.com/reference/com/google/android/play/core/install/model/UpdateAvailability.html#UPDATE_AVAILABLE).

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |