如何确保Android设备应用程序支持硬件功能 [英] How to make sure an android device application supports hardware feature
问题描述
我正在开发一个广泛使用相机的应用程序。我想做的是,如果设备或平板电脑没有摄像头,则不应在其上安装我的应用程序。
I am developing an application which uses camera extensively. What I wish to do is that if a device or tablet does not have camera it my application should not get installed on it.
检查了Android清单中的< uses-feature>
,但仅检查了何时通过android marketplace安装了应用程序。如果我打算也可以在我的网站上使用该怎么办。那么有什么办法可以解决这个问题,以便在设备没有摄像头硬件的情况下不安装应用程序?
Checked the <uses-feature>
in android manifest but only checks when application is installed via android marketplace. What if I intend it to be also available my site. So is there a way I can handle this so that application should not get installed in case device does not have a camera hardware?
谢谢,
〜nil
Thanks, ~nil
推荐答案
将其添加到清单中:
<uses-feature android:name="android.hardware.camera" android:required="true" />
这篇关于如何确保Android设备应用程序支持硬件功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!