A plug-and-play Android dependency for seamless real-time app updates without relying on Play Store or third-party services. Works with any backend or shared hosting by fetching update info from a simple JSON file on your own server.
- Real-time update checking from your own server
- Display new version number and detailed “What’s New” changelog
- Show download progress of the update APK
- Track installation progress
- Automatic permission management (including unknown sources install permission)
- Easy integration with minimal setup
- Works on shared hosting and any backend serving static or dynamic JSON
- Fully customizable UI to match your app style
- Host an
update.jsonfile on your server with the latest version info, changelog, and APK URL. - Add
InAppUpdateManagerdependency to your Android app. - Configure the URL pointing to your hosted
update.json. - The library checks for updates at app launch or periodically, shows the update screen if a new version is available, downloads the APK, and manages installation with progress tracking.
{
"latest_version": "2.0.1",
"mandatory": true,
"update_url": "https://yourdomain.com/downloads/app-v2.0.1.apk",
"title": "Version 2.0.1 Released!",
"description": "Bug fixes and performance improvements."
}Add the dependency to your build.gradle file:
implementation 'com.yourdomain:inappupdatemanager:1.0.0'To integrate InAppUpdateManager into your Android app, follow these steps:
- Initialize the update manager by providing the app context.
- Set the URL pointing to your hosted update JSON file.
- Call the
checkForUpdate()method to trigger the update check.
// Create an instance of the update manager
val updateManager = InAppUpdateManager(context)
// Set the URL of your update JSON hosted on your server
updateManager.setUpdateJsonUrl("https://yourdomain.com/update.json")
// Check for updates (call this at app launch or whenever appropriate)
updateManager.checkForUpdate()The following permissions are required for InAppUpdateManager to function correctly:
<uses-permission android:name="android.permission.INTERNET" /><uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />