Android - 检查APP是否已安装
我想要一个网页,其中包含指向市场中 apk 应用程序的链接(这是可能的),但如果该应用程序已存在于设备上,则不希望他重定向市场,但该应用程序会在设备上的应用程序。
这可能吗?
谢谢
I wanted to have a web page with a link pointing to the apk app in a market (this is possible), but if the app already exists on the device did not want him to redirect the market but that the app is open soon as the app on the device.
Is that possible?
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有办法在网站上做到这一点。您可以创建指向 Market 上应用程序的链接,如果用户使用的是 Android 设备,他或她将被重定向到 Market 应用程序 - 从这里可以查看它是否已安装。
如果您想在 Java 代码中执行此操作,可以使用 @Pedro 的建议进行简单的检查。
There's no way to do that on a website. You can create a link to the application on Market, and if the user is on an Android device, he or she will be redirected to the Market application - from here it's possible to see if it's installed or not.
Should you want to do it in Java code, you can use @Pedro's advice with a simple check.
您可以使用 PackageManager.getInstalledApplications 和检查您要查找的应用程序是否已列出。
You can use PackageManager.getInstalledApplications and check if the app you're looking for is listed.