Reputation: 199
please, from Android native; does someone has an idea of how to check if the running app was installed from Android app bundle or directly from APK?
I have an app that allows itself to be shared to others as APK However, when the app was installed from app-bundle, the resulting shared APK can not be run on all devices. therefore, I am trying to make a checkup to determine if the app was installed directly from APK before displaying this specific feature (and remove it if installed from app bundle) I will appreciate any help or weblink or clues. The PackageManager.class seems to not have a method about it.
Upvotes: 2
Views: 1308
Reputation: 176
You can check the installerPackageName on the PackageManager to know if the app was installed from the Play Store or sideloaded.
Upvotes: 1