DEV Community

Cover image for How to easily implement new In-App update feature to your Android App
Sanoj Punchihewa
Sanoj Punchihewa

Posted on

How to easily implement new In-App update feature to your Android App

Working all night to fix a bug or add a groundbreaking feature to your Android app and seeing only a few users have updated their apps? No worries now, Android have now released a new feature called in-app updates where you can prompt the user to update the app.


Although some users enable background updates when their device is connected to an unmetered connection, other users may need to be reminded to update. In-app updates is a Play Core library feature that introduces a new request flow to prompt active users to update your app.

As an Android developer, I felt tired adding all these codes to my apps. Thus I developed a library which will put in place the in-app update feature cutting down all the lines of code to 5 lines of code.

Let’s get started!


Step 1: Add jitpack to your root level build.gradle at the end of repositories

allprojects {
    repositories {
        maven { url "" }

Step 2: Add the dependency to app level build.gradle

dependencies {
    implementation 'com.github.SanojPunchihewa:InAppUpdater:1.0.2'

Step 3: Initialize the UpdateManager in your onCreate method of the Activity

protected void onCreate(Bundle savedInstanceState) {

    // Initialize the UpdateManager


There are two update modes as Flexible and Immediate,

  • 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: Call continueUpdate method in your onResume method to install waiting updates

protected void onResume() {

Tadaa! That’s it. Now you have in-app updates in your android app

If this helped you please give some ❤️ to this article and ⭐️ the library

Since I released the library recently 😉, if you find any bugs or have a suggestion please raise an issue

Also if you find it hard to get working, leave a comment, I am always happy to help you 😃

Top comments (1)

fsghasemi profile image
Fahime Ghasemi

Is it possible to implement in-app update for apps that published in HUAWEI AppGallery?