我正在创建一个移动网站,其中包含一个页面,人们可以从该页面下载我们推荐的相关应用.我发现 instructions 用于创建链接以启动市场,但这假设您是相关应用程序的开发人员并且知道确切的包名称.
I'm creating a mobile website that will include a page from which people can download relevant apps that we recommend. I've found instructions for creating the links to launch the Market but this assumes that you are the developer of the app in question and know the exact package name.
除了联系开发者询问外,有什么方法可以获取包名吗?
Is there any way to get the package name, other than just contacting the developers and asking?
此外,事实证明,这些说明对于创建 Web 超链接并不真正有效.它们只为您提供一个 URI,供您在另一个 Android 应用程序的 Java 代码字符串中引用.我们的站点在 Drupal 中,所以 Java 无法运行.
Also, it turns out that those instructions don't really work for creating web hyperlinks. They only give you a URI to reference in a string of Java code in another Android app. Our site is in Drupal, so Java is not going to work.
对于 iPhone,我发现 简单说明我需要来自 iTunes 商店的 URL/链接样式,所以我正在寻找类似的信息.
For the iPhone, I found easy instructions for getting the URL/link style I need from the iTunes store, so I'm looking for info like that.
这取决于你想从哪里获取信息.你有很多选择:
It depends where exactly you want to get the information from. You have a bunch of options:
<manifest>
元素将具有 package
属性.adb
进行连接,则可以启动 adb shell
并执行 pm list packages -f
,显示每个已安装 apk 的包名称.PackageManager
<manifest>
element will have a package
attribute.adb
, you can launch adb shell
and execute pm list packages -f
, which shows the package name for each installed apk.PackageManager
获得包名后,您只需链接到 market://search?q=pname:<package_name>
或 http://market.android.com/search?q=pname:<package_name>
.两者都将在 Android 设备上打开市场;后者显然也有可能在其他硬件上工作(目前还没有).
Once you've got the package name, you simply link to market://search?q=pname:<package_name>
or http://market.android.com/search?q=pname:<package_name>
. Both will open the market on an Android device; the latter obviously has the potential to work on other hardware as well (it doesn't at the minute).
这篇关于查找 Android 应用程序的包名称以使用 Intent 从 Web 启动 Market 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!