时间:2011-06-29 22:48:24

标签: android uses-feature

我有一个问题:
在其Manifest文件中指定 - uses-feature ... "android.hardware.faketouch" android:required="true" - 的应用程序也将在Market中显示如何在触摸屏设备中运行的应用程序?

2 个答案:

答案 0 :(得分:7)

如果您指定android.hardware.faketouch的要求,那么所有正版触控设备仍会看到列出的应用程序。

faketouch是触摸屏的一个子集,因此任何拥有真正触摸屏的人都对faketouch有隐含的支持,因为他们可以执行它支持的所有操作。

然而,市场存在一个小问题,你需要覆盖隐含的触摸屏条目并为其添加required = false。如果不这样做,将意味着市场会根据需要列出触摸屏和faketouch,因此仍然没有将其显示为faketouch设备。

因此,您的清单应包含:

<uses-feature android:name="android.hardware.faketouch"/>
<uses-feature android:required="false" android:name="android.hardware.touchscreen"/>

这样,您的应用就可以展示各种设备,包括faketouch only。

答案 1 :(得分:2)

http://www.saschahlusiak.de/2012/10/android-hardware-faketouch-vs-android-hardware-touchscreen/

  

默认情况下,Android应用程序需要功能 android.hardware.touchscreen ,该功能随后会在Google Play中用于过滤,因此只有具有触摸屏功能的设备才能安装该功能应用程序。

     

除此之外,还有一个更基本的功能, android.hardware.faketouch

     

如果应用程序不需要触摸屏功能,建议将android.hardware.touchscreen设置为不需要,而是声明 android.hardware.faketouch

<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.faketouch" android:required="true" />
     

如果这样做,请在Google Play上查看结果,其中显示了支持的设备数量:

     
      
  • 需要触摸屏,不需要faketouch:1500
  •   
  • 不需要触摸屏,需要假触摸:860
  •   
  • 都不需要:1800
  •