MayurDev / AppUpdater

A library that checks for your apps' updates on Google Play, GitHub, Amazon or F-Droid. API 8+ required.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AppUpdater

Android Library

Android Library that checks for updates on Google Play, GitHub, Amazon or F-Droid. This library notifies your apps' updates by showing a Material dialog, Snackbar or notification.

Sample Project

You can download the latest sample APK from Google Play:

How to include

Add the repository to your project build.gradle:

repositories {
    maven {
        url "https://jitpack.io"
    }
}

And add the library to your module build.gradle:

dependencies {
    compile 'com.github.javiersantos:AppUpdater:1.1'
}

Usage

Add INTERNET and ACCESS_NETWORK_STATE permissions to your app's Manifest:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Activity

AppUpdater appUpdater = new AppUpdater(this);
appUpdater.start();

Fragment

AppUpdater appUpdater = new AppUpdater(getActivity());
appUpdater.start();

Customization

Use the builder and add following:

// (Optional) Provide a Display mode.
// Default: Display.DIALOG
.setDisplay(Display.DIALOG)
.setDisplay(Display.SNACKBAR)
.setDisplay(Display.NOTIFICATION)
// (Optional) Provide a duration for the Snackbars. 
// Default: Duration.NORMAL
.setDuration(Duration.NORMAL)
.setDuration(Duration.INDEFINITE)
// (Optional) Provide a source for the updates. 
// Default: UpdateFrom.GOOGLE_PLAY
.setUpdateFrom(UpdateFrom.GOOGLE_PLAY)
.setUpdateFrom(UpdateFrom.GITHUB)
.setUpdateFrom(UpdateFrom.AMAZON)
.setUpdateFrom(UpdateFrom.FDROID)
// (Required for GITHUB, optional otherwise) Provide the GitHub user and repo where releases are available.
.setGitHubUserAndRepo("javiersantos", "AppUpdater")
// (Optional) Updates will be displayed only every X times the app ascertains that a new update is available. 
// Default: 1 (Always)
.showEvery(5)
// (Optional) Show dialog, snackbar or notification although there aren't updates. 
// Default: false
.showAppUpdated(true)

Other features

Get the latest update and compare with the installed one (asynchronous)

AppUpdaterUtils appUpdaterUtils = new AppUpdaterUtils(this)
    //.setUpdateFrom(UpdateFrom.AMAZON)
    //.setUpdateFrom(UpdateFrom.FDROID)
    //.setUpdateFrom(UpdateFrom.GITHUB)
    //.setGitHubUserAndRepo("javiersantos", "AppUpdater")
    .withListener(new AppUpdaterUtils.AppUpdaterListener() {
        @Override
        public void onSuccess(String latestVersion, Boolean isUpdateAvailable) {
            Log.d("AppUpdater", latestVersion + ", " + Boolean.toString(isUpdateAvailable));
        });
appUpdaterUtils.start();

ML Manager

License

Copyright 2016 Javier Santos

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

A library that checks for your apps' updates on Google Play, GitHub, Amazon or F-Droid. API 8+ required.

License:Apache License 2.0


Languages

Language:Java 100.0%