A simple, lightweight update checker for Android apps. It reads a JSON file you host yourself, compares the version code with the installed one, and hands you the result — you decide what dialog or snackbar to show.
- You host the JSON — GitHub raw, S3, your own server, anything reachable over HTTP
- Forceable updates — a
cancellableflag in the JSON lets you block the app until the user updates - No UI imposed on you — the library gives you the data, you build the dialog
- Tiny — one class, no dependency on Play Services or any update SDK
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}Add the dependency
dependencies {
implementation 'com.github.p32929:AndroidAppUpdater:1.0.2'
}Steps to follow:
- Create new
new AppUpdater(context, jsonUrl, listener) - Execute the task
- Do something if update is available
In your Activity or Fragment, you can add the code below:
new AppUpdater(this, "https://raw.githubusercontent.com/p32929/SomeHowTosAndTexts/master/Updater/updater.json", new UpdateListener() {
@Override
public void onJsonDataReceived(final UpdateModel updateModel, JSONObject jsonObject) {
if (AppUpdater.getCurrentVersionCode(MainActivity.this) < updateModel.getVersionCode()) {
new AlertDialog.Builder(MainActivity.this)
.setTitle("Update available")
.setCancelable(updateModel.isCancellable())
.setPositiveButton("Update", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(updateModel.getUrl()));
startActivity(browserIntent);
finish();
}
})
.show();
}
}
@Override
public void onError(String error) {
// Do something
}
}).execute();the JSON data should be like below:
{
"versionCode": 1, // Updated version code
"cancellable": false, // If you want to force users to update the app
"url": "http://tiny.cc/BuySellBD" // If you want users to update the app from an External URL or from the Google Play URL
}
If you add more data in the JSON file, you can get them from the jsonObject variable.
Hope you will enjoy using the library :) Thanks :)
MIT License — Copyright (c) 2019 Fayaz Bin Salam. See LICENSE for the full text.
Contributions are warmly welcomed and greatly appreciated! Whether it's a bug fix, new feature, or improvement, your input helps make this project better for everyone.
Before submitting a pull request, please:
- Create an issue describing the feature or bug fix you'd like to work on
- Wait for discussion and approval to ensure alignment with project goals
- Fork the repository and create your feature branch
- Submit your pull request with a clear description of changes
This approach helps avoid duplicate efforts and ensures smooth collaboration. Thank you for considering contributing!
Sharing this repository with your friends is just one click away from here
If this saved you time, you can buy me a coffee — it keeps these projects maintained and free. Other payment options: https://p32929.github.io/SendMoney2MeV1/
I do fixed-price delivery work on my own projects. One invoice, one date, no hourly billing:
| White-label build — this project rebranded, extended and deployed as yours | $6,500 · 3 weeks |
| Custom app from scratch on my own stack, signed and auto-updating | $12,500 · 6 weeks |
| Production-hardening sprint — 72 hours on this project, for your load and your security review | $999 |
| Ongoing capacity — one project-week of my time reserved every month | $9,000 / month |
Full details → p32929.github.io/hire · Email fayazdevinbox@uberip.com — scoping and quotes are free and I answer within one business day.







