Java Code Examples for com.google.android.play.core.install.model.InstallStatus#DOWNLOADED
The following examples show how to use
com.google.android.play.core.install.model.InstallStatus#DOWNLOADED .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UpdateManager.java From InAppUpdater with MIT License | 6 votes |
@Override public void onStateUpdate(InstallState installState) { if (installState.installStatus() == InstallStatus.DOWNLOADING) { long bytesDownloaded = installState.bytesDownloaded(); long totalBytesToDownload = installState.totalBytesToDownload(); if (flexibleUpdateDownloadListener != null) { flexibleUpdateDownloadListener.onDownloadProgress(bytesDownloaded, totalBytesToDownload); } } if (installState.installStatus() == InstallStatus.DOWNLOADED) { // After the update is downloaded, show a notification // and request user confirmation to restart the app. Log.d(TAG, "An update has been downloaded"); popupSnackbarForCompleteUpdate(); } }
Example 2
Source File: CommcareFlexibleAppUpdateManager.java From commcare-android with Apache License 2.0 | 6 votes |
/** * Gets {@link AppUpdateState} using {@link #mUpdateAvailability} and {@link #mInstallStatus} */ private AppUpdateState getAppUpdateState() { AppUpdateState state = AppUpdateState.UNAVAILABLE; switch (mInstallStatus) { case InstallStatus.PENDING: case InstallStatus.DOWNLOADING: state = AppUpdateState.DOWNLOADING; break; case InstallStatus.DOWNLOADED: state = AppUpdateState.DOWNLOADED; break; case InstallStatus.FAILED: state = AppUpdateState.FAILED; break; } if (state == AppUpdateState.UNAVAILABLE && mUpdateAvailability == UpdateAvailability.UPDATE_AVAILABLE) { state = AppUpdateState.AVAILABLE; } return state; }
Example 3
Source File: InAppUpdateManager.java From android-inapp-update with Apache License 2.0 | 5 votes |
@Override public void onStateUpdate(InstallState installState) { inAppUpdateStatus.setInstallState(installState); reportStatus(); // Show module progress, log state, or install the update. if (installState.installStatus() == InstallStatus.DOWNLOADED) { // After the update is downloaded, show a notification // and request user confirmation to restart the app. popupSnackbarForUserConfirmation(); } }
Example 4
Source File: MainActivity.java From VoIpUSSD with Apache License 2.0 | 5 votes |
@Override public void onStateUpdate(InstallState installState) { if (installState.installStatus() == InstallStatus.DOWNLOADED) { showMessage("Has been Downloaded!!!"); notifyUser(); } }
Example 5
Source File: InAppUpdateStatus.java From android-inapp-update with Apache License 2.0 | 4 votes |
public boolean isDownloaded() { if (installState != null) return installState.installStatus() == InstallStatus.DOWNLOADED; return false; }