开发者

android: how can I verify, that device support multitouch?

How can I verify, that d开发者_如何学Cevice 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.


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.


A quick example:

boolean multi = 
getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH);


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


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;
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜