Android - 检查APP是否已安装

时间:2021-07-20 04:09:32

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.

我希望有一个网页,其链接指向市场中的apk应用程序(这是可能的),但如果应用程序已存在于设备上,则不希望他重定向市场,但应用程序很快就会打开设备上的应用程序。

Is that possible?

那可能吗?

thank you

谢谢

2 个解决方案

#1


2  

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.

在网站上没有办法做到这一点。您可以在Market上创建指向应用程序的链接,如果用户在Android设备上,他或她将被重定向到Market应用程序 - 从这里可以看到它是否已安装。

Should you want to do it in Java code, you can use @Pedro's advice with a simple check.

如果您想在Java代码中执行此操作,可以使用@ Pedro的建议进行简单检查。

#2


1  

You can use PackageManager.getInstalledApplications and check if the app you're looking for is listed.

您可以使用PackageManager.getInstalledApplications并检查是否列出了您要查找的应用程序。

#1


2  

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.

在网站上没有办法做到这一点。您可以在Market上创建指向应用程序的链接,如果用户在Android设备上,他或她将被重定向到Market应用程序 - 从这里可以看到它是否已安装。

Should you want to do it in Java code, you can use @Pedro's advice with a simple check.

如果您想在Java代码中执行此操作,可以使用@ Pedro的建议进行简单检查。

#2


1  

You can use PackageManager.getInstalledApplications and check if the app you're looking for is listed.

您可以使用PackageManager.getInstalledApplications并检查是否列出了您要查找的应用程序。