InAppUpdater
Android Library to easily implement in-app updates.
:pencil2: Usage
Step 1: Add it in your root build.gradle
Step 2: Add the dependency
Step 3: Initialize the UpdateManager
Declare the UpdateManager in your Activity
Initialize the UpdateManager in your onCreate
method of the Activity
Update Mode
There are two modes
-
Flexible(
UpdateManagerConstant.FLEXIBLE
) (default) - User can use the app during update download, installation and restart needs to be triggered by user -
Immediate(
UpdateManagerConstant.IMMEDIATE
) - User will be blocked until download and installation is finished, restart is triggered automatically
Step 4: Resume the updates
Call continueUpdate
method in your onResume
method to install waiting updates
Additionally you can get the Available Version Code of the update. You can find these codes in the demo app
:movie_camera: Demo
Flexible Update | Immediate Update |
---|---|
![]() |
![]() |
:exclamation: Troubleshoot
- In-app updates works only with devices running Android 5.0 (API level 21) or higher
- In-app updates are available only to user accounts that own the app. So, make sure the account you’re using has downloaded your app from Google Play at least once before using the account to test in-app updates.
- Make sure that the app that you are testing in-app updates with has the same application ID and is signed with the same signing key as the one available from Google Play.
- Because Google Play can only update an app to a higher version code, make sure the app you are testing as a lower version code than the update version code.