Is there a way to detect if app was installed with Market or not?

前端 未结 2 572
悲哀的现实
悲哀的现实 2020-12-08 00:45

I am wondering if I am able to detect if my application was installed with Android Market (it\'s in the download list of the Market and eligible for update checks) or it\'s

相关标签:
2条回答
  • 2020-12-08 01:41

    If you're not root (and have access to Market database), I don't think it's possible.

    0 讨论(0)
  • 2020-12-08 01:42

    In your activity do

    PackageManager pm = getPackageManager();
    String installationSource = pm.getInstallerPackageName(getPackageName());
    

    installationSource will now hold the package name of the app that installed your app.

    testing with an app of mine installation source is "com.google.android.feedback" when installed via google market, null if installed via debugger.

    0 讨论(0)
提交回复
热议问题