Add the repository to your project build.gradle:
repositories {
maven {
url "https://jitpack.io"
}
}
And add the library to your module build.gradle:
dependencies {
implementation 'com.github.GauthamAsir:AppUpdater:1.1'
}
Library compares the App version name & Github Tag Name. It has native downloader which downloads the apk from github releases and It installs the apk after download is completed.
Github Tag Name should not contain any alphabets, it can be decimal (Eg: 1.1) Make sure you enter proper Github Username and Repo
AppUpdater appUpdater = new AppUpdater(this);
appUpdater.setDisplay(Display.DIALOG);
appUpdater.setUpGithub("username", "reponame");
appUpdater.start();
AppUpdater appUpdater = new AppUpdater(this);
appUpdater.setDisplay(Display.SNACKBAR);
appUpdater.setUpGithub("username", "reponame");
appUpdater.start();
AppUpdater appUpdater = new AppUpdater(this);
appUpdater.setDisplay(Display.NOTIFICATION);
appUpdater.setUpGithub("username", "reponame");
appUpdater.start();
On Click of Notification it navigates to the Update Activity.
It handles the changelogs also, which is the release description from Github
Intent updateIntent = new Intent(getApplicationContext(),UpdateActivity.class);
updateIntent.putExtra("username","GauthamAsir");
updateIntent.putExtra("repoName","AppUpdater");
startActivity(updateIntent);
appUpdater.setDialogStyle(R.style.dialogAlertStyle);
<style name="dialogAlertStyle" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
<item name="colorPrimary">@color/colorAccent</item>
<item name="colorSecondary">@color/colorAccent</item>
</style>
appUpdater.setDialogBtnPositive("Update");
appUpdater.setDialogBtnNegative("Dismiss");
appUpdater.setDialog_icon(R.drawable.ic_system_update_black_24dp);
appUpdater.setDialogTitle("new title");
appUpdater.setDialogMessage("message");
By default its false
appUpdater.setDialogCancelable(true);