AppVerUpdater
AppVerUpdater copied to clipboard
Error Downloading Updates
Hi,
I am getting error on downloading updates, An error occurred when downloading updates.. I could only get this on Logcat
2019-01-07 11:33:14.060 17587-18098/my.sustento.zankoattendancesystemzas V/ThinDownloadManager: Download initiated for 1
2019-01-07 11:33:14.346 17587-18098/my.sustento.zankoattendancesystemzas V/ThinDownloadManager: Response code obtained for downloaded Id 1 : httpResponse Code 200
2019-01-07 11:33:14.346 17587-18098/my.sustento.zankoattendancesystemzas D/ThinDownloadManager: cleanupDestination() deleting /storage/emulated/0/Download/update-2019-01-07.apk
I am using version 1.0.10
My code as follows
private void update(){
// Using https://github.com/atzcx/AppVerUpdater as json updater for app
//
appVerUpdater = new AppVerUpdater()
.setUpdateJSONUrl("https://zanko-attendance-system.firebaseapp.com/assets/update.json")
.setShowNotUpdated(true)
.setViewNotes(true)
.setCallback(new Callback() {
@Override
public void onFailure(UpdateErrors error) {
if (error == UpdateErrors.NETWORK_NOT_AVAILABLE) {
Toast.makeText(ExitActivity.this, "No internet connection.", Toast.LENGTH_LONG).show();
}
else if (error == UpdateErrors.ERROR_CHECKING_UPDATES) {
Toast.makeText(ExitActivity.this, "An error occurred while checking for updates.", Toast.LENGTH_LONG).show();
}
else if (error == UpdateErrors.ERROR_DOWNLOADING_UPDATES) {
Toast.makeText(ExitActivity.this, "An error occurred when downloading updates.", Toast.LENGTH_LONG).show();
}
else if (error == UpdateErrors.JSON_FILE_IS_MISSING) {
Toast.makeText(ExitActivity.this, "Json file is missing.", Toast.LENGTH_LONG).show();
}
else if (error == UpdateErrors.FILE_JSON_NO_DATA) {
Toast.makeText(ExitActivity.this, "The file containing information about the updates are empty.", Toast.LENGTH_LONG).show();
}
}
@Override
public void onDownloadSuccess() {
// for example, record/reset license
}
@Override
public void onUpdateChecked(boolean downloading) {
// Happens after an update check, immediately after if update check was successful and there
// were no dialogs, or, when an update dialog is presented and user explicitly dismissed the dialog.
// "downloading" is true if user accepted the update
// Typically used for resetting next update check time
}
})
.setAlertDialogCancelable(true)
.build(this);
}
@Override
protected void onResume() {
super.onResume();
appVerUpdater.onResume(this);
}
@Override
protected void onStop() {
super.onStop();
appVerUpdater.onStop(this);
}
My json
{
"newVersion": "0.4.6",
"apkUrl":
"https://zanko-attendance-system.firebaseapp.com/assets/ZAS046.apk",
"versionNotes": [
"- Bug fixes",
"- Changes GPS code"
]
}```