Just like BuildConfig.FLAVOR
and BuildConfig.DEBUG
is there a build flag to check at runtime for the APK version or the Instant App version of an Android application ?
Or is there another way to get the information ?
5 examples of Android instant apps you can trySkyscanner: flights and hotels: access to cheap tickets, accommodation and car rental, with an alert system. NYTimes Crossword: crosswords of The New York Times. Buzzfeed: Quiz, Tasty, News: full access to the platform app.
If you want to locate the APK files in your Android phones, you can find the APK for user-installed apps under /data/app/directory while the preinstalled ones are located in /system/app folder and you can access them by using ES File Explorer.
Package Manager is a highly powerful application to manage apps, both system and user, installed on an android device.
Distribute your app to testersSelect your Firebase project when prompted. On the Releases page, select the app you want to distribute from the drop-down menu. Drag your app's APK file to the console to upload it. When the upload completes, specify the tester groups and individual testers you want to receive the build.
Add to the module build.gradle
the dependency : implementation 'com.google.android.instantapps:instantapps:1.0.0'
then you will be able to use the function InstantApps.isInstantApp(this)
.
Please note that you must use Maven Google by changing your repositories in the project build.gradle
:
buildscript {
repositories {
maven {
url 'https://maven.google.com'
}
jcenter()
}
...
}
allprojects {
repositories {
maven {
url 'https://maven.google.com'
}
jcenter()
}
}
Android Instant Apps API reference
Easiest way is to use PackageManager.isInstantApp()
:
https://developers.google.com/android/reference/com/google/android/gms/instantapps/PackageManagerCompat.html#isInstantApp()
Or, a regular (non-appcompat version) https://developer.android.com/reference/android/content/pm/PackageManager#isInstantApp()
Also has an override which accepts package name as a string, which allows to check other apps, if permissions allow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With