从亚马逊应用商店安装的

从亚马逊应用商店安装的

本文介绍了可以PackageManager.getInstallerPackageName()告诉我,我的应用程序,从亚马逊应用商店安装的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算出版我在亚马逊应用商店的应用程序和谷歌播放,并在我的应用程序的一些事情需要表现略有不同,从亚马逊的应用程序商店或没有应用程序是否已安装。如果我理解正确的 PackageManager.getInstallerPackageName(字符串的packageName)的方法,它告诉我,我的安装应用程序中的应用程序的名称。对?如果是这样,没有人知道这个方法返回的值是,如果我的应用程序的的安装从亚马逊的应用程序商店是什么?如果没有,有没有人知道任何其他方法,我可以用它来确定从亚马逊应用商店我的应用程序是否已安装?

解决方案

调用 PackageManager.getInstallerPackageName(myPackageName),其中 myPackageName 是包的名称(您要确定安装的app)给出了以下值:

  • 如果应用程序是从亚马逊应用商店安装
  • 如果已安装的应用程序的直接的任何应用程序商店的外面。
  • com.android.vending 如果应用程序是从谷歌安装播放。

(感谢@CommonsWare的指针。)

I plan on publishing my app on Amazon app store as well as Google Play, and have some things in my app that need to behave slightly different depending on whether the app was installed from Amazon app store or not. If I understood the PackageManager.getInstallerPackageName(String packageName) method correctly, it tells me the name of the application that installed my app. Right? If so, does anyone know what the value returned by this method would be if my app was installed from Amazon app store? If not, does anyone know any other methods I can use to determine whether my app was installed from the Amazon app store?

解决方案

Calling PackageManager.getInstallerPackageName(myPackageName), where myPackageName is the name of the package (of the app for which you wish to determine the installer) gives the following values:

  • null if the app was installed from Amazon app store
  • null if the app was installed directly outside of any app store.
  • com.android.vending if the app was installed from Google Play.

(Thanks @CommonsWare for the pointer.)

这篇关于可以PackageManager.getInstallerPackageName()告诉我,我的应用程序,从亚马逊应用商店安装的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 04:09