Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.
/ AppUpdater Public archive

Simple App Updater From Github releases and App version Name

Notifications You must be signed in to change notification settings

GauthamAsir/AppUpdater

Repository files navigation

AppUpdater

How to include to your project

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'
}

Instructions

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.

Note

Github Tag Name should not contain any alphabets, it can be decimal (Eg: 1.1) Make sure you enter proper Github Username and Repo

Usage

Displaying a dialog, Snackbar notification or activity

Dialog

AppUpdater appUpdater = new AppUpdater(this);
appUpdater.setDisplay(Display.DIALOG);
appUpdater.setUpGithub("username", "reponame");
appUpdater.start();

For SnackBar

AppUpdater appUpdater = new AppUpdater(this);
appUpdater.setDisplay(Display.SNACKBAR);
appUpdater.setUpGithub("username", "reponame");
appUpdater.start();

For Notification

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.

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);

Customizations

Customizing Dialog

Dialog Style
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>
Dialog Buttons Text
appUpdater.setDialogBtnPositive("Update");
appUpdater.setDialogBtnNegative("Dismiss");
Dialog Icon
appUpdater.setDialog_icon(R.drawable.ic_system_update_black_24dp);
Dialog Title
appUpdater.setDialogTitle("new title");
Dialog Message
appUpdater.setDialogMessage("message");
Dialog Set Cancelable

By default its false

appUpdater.setDialogCancelable(true);