Setting Up In-App Update (Forced Update) in Android App

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Setting Up In-App Update (Forced Update) in Android App
Medium
from 4 hours to 2 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Setting Up In-App Update (Forced Update) in Android Apps

Users don't update themselves. Per Play Console data, median time between release and update installation is about three weeks. If new version has critical security fix or broken API — that's three weeks with open vulnerability. In-App Update API solves this directly from the app without relying on user consciousness.

Two Modes and When to Choose Each

Google Play In-App Update API, available via com.google.android.play:app-update-ktx, provides two scenarios.

Flexible update — background download, user continues work. Suits feature releases. After download completes, snackbar appears with "Restart" button. If user dismisses it, need separate tracking of InstallStatus.DOWNLOADED and show repeated request.

Immediate update — full-screen blocking interface from Google Play. App is essentially unavailable until update completes. Use for critical patches: encryption schema change, mandatory DB migration, backend API version discontinuation. Important: Immediate update doesn't guarantee user updates. User can close app — onActivityResult returns RESULT_CANCELED, need to handle correctly, otherwise app becomes completely unavailable.

What Really Causes Problems

Most common mistake — initializing AppUpdateManager without availability check. Method appUpdateManager.appUpdateInfo returns Task<AppUpdateInfo>, must await asynchronously. Calling startUpdateFlowForResult without ready AppUpdateInfo throws IllegalStateException at runtime.

Second common bug — not accounting for updateAvailability == UPDATE_NOT_AVAILABLE on Firebase App Distribution builds or testing via FakeAppUpdateManager. In production unreachable, but CI tests fail.

Third problem — versioning. Comparison by versionCode, not versionName. If multiple flavors of one app use same versionCode — update won't be offered even if binaries differ.

How We Implement

Integration starts with auditing current versioning scheme — verify versionCode increases monotonically with no flavor collisions. Then add dependency and write UpdateManager class in domain layer (clean architecture — UI doesn't know Play Services directly).

val appUpdateManager = AppUpdateManagerFactory.create(context)
val appUpdateInfoTask = appUpdateManager.appUpdateInfo

appUpdateInfoTask.addOnSuccessListener { info ->
    if (info.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
        && info.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)
    ) {
        appUpdateManager.startUpdateFlowForResult(
            info, AppUpdateType.FLEXIBLE, activity, REQUEST_CODE_UPDATE
        )
    }
}

For Immediate scenario add staleDays — forced update activates only if update available more than N days. Reduces user frustration with minor patches.

onResume handling critical: if user minimized app during Flexible download and returned — must check installStatus and offer restart. Without this, app runs old code though new already on disk.

Testing

FakeAppUpdateManager from play-app-update emulates all states without publishing to Play Store. In Espresso tests can run full cycle: availability → download start → completion → restart. Without coverage, update flow bugs reach production undetected — Google Play shows UI over app, standard UI tests don't see it.

Process

Analyze current architecture and versioning scheme. Determine which releases should be Immediate, which Flexible — usually fixed in release checklist. Implement and cover with tests. Final verification — Internal Testing track in Play Console on real device.

Timeline — 2 to 5 working days depending on app architecture complexity.