Programmatically find how many fingers in multitouch Android device supports

老子叫甜甜 提交于 2019-12-04 03:33:49
andr

As far as I know, there is no way of obtaining the exact number of pointers supported by a device. I don't want to reinvent the wheel here, so I'd like to share a similar problem and a great answer here: Android multitouch in supported devices.

To summarize, notable is the method PackageManager.hasSystemFeature() which allows you to find out in which multitouch-support category does current device belong. Useful feature codes include:

  • FEATURE_TOUCHSCREEN_MULTITOUCH - basic support for 2 pointers
  • FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT - support for 2+ independent pointers.
  • FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND - support for 5+ independent pointers.

Instead of checking just for MULTITOUCH, you want to check for FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!