android判断当前设备的支持哪些Feature

android判断当前设备的支持哪些Feature

可以使用 public abstract boolean hasSystemFeature (String name)判断是否支持某个属性

在应用程序中使用方法

if(!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS)){/**/}

还可以用 getSystemAvailableFeatures ()列出当前设备所有属性。

对于设备端来说,是否支持这些feature,就要放各种.xml文件到 /system/etc/permissions下面诸如:
android.hardware.camera.front.xml
android.hardware.location.gps.xml
android.hardware.sensor.accelerometer.xml
android.hardware.telephony.gsm.xml
android.hardware.touchscreen.multitouch.jazzhand.xml
android.hardware.usb.accessory.xml
android.hardware.wifi.xml
等等这些文件存在于frameworks/base/data/etc
修改Android.mk就可把他们放到/system/etc/permissions里面去了。

在rk方案中所有许可的路径是\frameworks\native\data\etc\下
cope的mk文件是device\rockchip\rk30sdk\device.mk
目标目录是out\target\product\rk30sdk\system\etc\permissions\
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值