getInstallerPackageName returns null

后端 未结 3 539
长发绾君心
长发绾君心 2020-12-06 19:41

In my Android app I wanted to check the source of app installation. I looked at the Android documentation and found the following API as part of the PackageManager class:

3条回答
  •  情歌与酒
    2020-12-06 20:08

    I tested this API method with both emulator and real devices. Most of the time, it returns null. Only return com.android.vending when the app is installed from official Google Play.

    With China local app market apps, such as AppChina and wandoujia, null is returned.

    Code snippet and log is posted here: Github Gist

提交回复
热议问题