14

How can I verify, that device support multitouch event? If device have resistent display, multitouch is not possible. Is that way to find out, what kind of display is in device, or if device support multitouch?

Thanks.

Peter
  • 197
  • 1
  • 7

4 Answers4

17

If you need multitouch, include:

<uses-feature android:name="android.hardware.touchscreen.multitouch" />

in your manifest. Your application will not be listed in the Market for devices that lack multitouch.

If you wish to conditionally support multitouch, use PackageManager and hasSystemFeature() to see if android.hardware.touchscreen.multitouch is available.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 3
    How common is it nowadays for an android not to support multi-touch? – SSH This Oct 24 '12 at 22:46
  • 1
    @SSHThis: Google TV doesn't. There are also varying levels of multitouch (e.g., "jazzhands" for supporting 10 simultaneous touches), for those apps with specific needs (e.g., piano keyboard simulators). – CommonsWare Oct 25 '12 at 05:49
  • Thanks for the response! Your answer helped me greatly – SSH This Oct 25 '12 at 15:45
11

A quick example:

boolean multi = 
getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH);
Lumis
  • 21,517
  • 8
  • 63
  • 67
4

You can use PackageManager.hasSystemFeature with PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH

There is an interesting series of articles on Android multi-touch that are worth a look

Hope this helps,

Phil Lello

Phil Lello
  • 8,377
  • 2
  • 25
  • 34
1
public final String SUPPORT = "Supported";
public final String NOT_SUPPORT = "None";

if (getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH)) {
            aDisplayInfo.multiTouch = SUPPORT;
        } else {
            aDisplayInfo.multiTouch = NOT_SUPPORT;
        }
Shihab Uddin
  • 6,699
  • 2
  • 59
  • 74