AndroidAppUpdater
Prompt your users to update — from any app store, in any UI framework. [+Supports third party Android marketplaces] [+ Supports Jetpack Compose]
Install / Use
/learn @HeyPouya/AndroidAppUpdaterREADME
Features
- Works with Jetpack Compose and XML Views (DialogFragment)
- Supports 16 app stores out of the box (Google Play, Huawei, Samsung, Amazon, and more)
- Direct APK download with built-in download management and installation
- Light, Dark, and System Default themes
- Force update mode (non-dismissable dialog)
- Custom typeface support
- DSL builders for clean, expressive configuration
- Built-in store icons for all supported stores
- Handles APK installation across all API levels (M through latest)
- Customizable string resources for localization
Installation
Add the dependency for the module that matches your UI toolkit:
dependencies {
// Jetpack Compose
implementation("com.pouyaheydari.updater:compose:latest_version")
// XML Views / DialogFragment
implementation("com.pouyaheydari.updater:main:latest_version")
}
Replace
latest_versionwith the latest version from Maven Central.
Quick Start
1. Define your store list
val stores = listOf(
StoreListItem(
store = StoreFactory.getStore(AppStoreType.GOOGLE_PLAY, "com.your.package"),
title = "Google Play",
icon = R.drawable.appupdater_ic_google_play
),
StoreListItem(
store = StoreFactory.getStore(AppStoreType.HUAWEI_APP_GALLERY, "com.your.package"),
title = "Huawei AppGallery",
icon = R.drawable.appupdater_ic_app_gallery
)
)
2. (Optional) Define direct download links
Add these permissions to your AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
Then create the list:
val directLinks = listOf(
DirectDownloadListItem(
title = "Direct Download",
url = "https://example.com/your-app.apk"
)
)
3. Show the dialog
Jetpack Compose
var showDialog by remember { mutableStateOf(true) }
if (showDialog) {
AndroidAppUpdater(
dialogData = UpdaterDialogData(
dialogTitle = "New Update Available!",
dialogDescription = "We've added new features and fixed bugs.",
dividerText = "or",
storeList = stores,
directDownloadList = directLinks,
onDismissRequested = { showDialog = false },
theme = Theme.SYSTEM_DEFAULT
)
)
}
DialogFragment (XML Views)
AppUpdaterDialog.getInstance(
UpdaterDialogData(
title = "New Update Available!",
description = "We've added new features and fixed bugs.",
storeList = stores,
directDownloadList = directLinks,
isForceUpdate = false,
theme = Theme.LIGHT
)
).show(supportFragmentManager, "updater")
DSL Builders
Both Compose and Fragment APIs offer Kotlin DSL builders for a more expressive syntax.
Fragment DSL
updateDialogBuilder {
title = "New Update Available!"
description = "We've added new features and fixed bugs."
isForceUpdate = false
theme = Theme.DARK
storeList = listOf(
store {
store = StoreFactory.getStore(AppStoreType.GOOGLE_PLAY, "com.your.package")
title = "Google Play"
icon = R.drawable.appupdater_ic_google_play
}
)
directDownloadList = listOf(
directDownload {
title = "Direct Download"
url = "https://example.com/your-app.apk"
}
)
typeface = Typeface.createFromAsset(assets, "fonts/custom.ttf")
errorWhileOpeningStoreCallback = { storeName ->
Toast.makeText(this@MainActivity, "$storeName is not installed", Toast.LENGTH_SHORT).show()
}
}.show(supportFragmentManager, "updater")
Compose DSL
val dialogData = updaterDialogData {
dialogTitle = "New Update Available!"
dialogDescription = "We've added new features and fixed bugs."
dividerText = "or"
theme = Theme.SYSTEM_DEFAULT
storeList = listOf(
store {
store = StoreFactory.getStore(AppStoreType.GOOGLE_PLAY, "com.your.package")
title = "Google Play"
icon = R.drawable.appupdater_ic_google_play
}
)
directDownloadList = listOf(
directDownload {
title = "Direct Download"
url = "https://example.com/your-app.apk"
}
)
onDismissRequested = { /* handle dismiss */ }
errorWhileOpeningStoreCallback = { storeName -> /* handle error */ }
}
AndroidAppUpdater(dialogData)
Configuration Reference
Fragment UpdaterDialogData
| Parameter | Type | Default | Description |
|----------------------------------|--------------------------------|------------------|-------------------------------------------|
| title | String | "" | Title shown at the top of the dialog |
| description | String | "" | Description text below the title |
| storeList | List<StoreListItem> | [] | App stores to show as update options |
| directDownloadList | List<DirectDownloadListItem> | [] | Direct APK download links |
| isForceUpdate | Boolean | false | If true, the dialog cannot be dismissed |
| typeface | Typeface? | null | Custom typeface for dialog text |
| theme | Theme | SYSTEM_DEFAULT | LIGHT, DARK, or SYSTEM_DEFAULT |
| errorWhileOpeningStoreCallback | ((String) -> Unit)? | null | Called with store name if opening fails |
Compose UpdaterDialogData
| Parameter | Type | Default | Description |
|----------------------------------|--------------------------------|------------------|--------------------------------------------------|
| dialogTitle | String | "" | Title shown at the top of the dialog |
| dialogDescription | String | "" | Description text below the title |
| dividerText | String | "" | Text on the divider between stores and downloads |
| storeList | List<StoreListItem> | [] | App stores to show as update options |
| directDownloadList | List<DirectDownloadListItem> | [] | Direct APK download links |
| onDismissRequested | () -> Unit | {} | Called when the user dismisses the dialog |
| typeface | Typeface? | null | Custom typeface for dialog text |
| theme | Theme | SYSTEM_DEFAULT | LIGHT, DARK, or SYSTEM_DEFAULT |
| errorWhileOpeningStoreCallback | (String) -> Unit | {} | Called with store name if opening fails |
Supported Stores
| Store | Enum Value | Built-in Icon |
|----------------------|------------------------|-----------------------------------|
| Google Play | GOOGLE_PLAY | appupdater_ic_google_play |
| Cafe Bazaar | CAFE_BAZAAR | appupdater_ic_bazar |
| Myket | MYKET | appupdater_ic_myket |
| Huawei AppGallery | HUAWEI_APP_GALLERY | appupdater_ic_app_gallery |
| Samsung Galaxy Store | SAMSUNG_GALAXY_STORE | appupdater_ic_galaxy_store |
| Amazon App Store | AMAZON_APP_STORE | appupdater_ic_amazon_app_store |
| Aptoide | APTOIDE | appupdater_ic_aptoide |
| F-Droid | FDROID | appupdater_ic_fdroid |
| Xiaomi GetApps | MI_GET_APP_STORE
