Android 1.5 多点触控

发布于 2024-08-29 13:57:11 字数 546 浏览 4 评论 0原文

有谁知道是否可以在 Android 1.5 设备上使用多点触控?

我有一台 HTC Hero,它仍然运行 1.5(HTC 在推出 2.1 ROM 方面有点慢)。

Android MotionEvent 文档显示了常量(ACTION_POINTER_1_DOWN、ACTION_POINTER_1_UP...等...)我需要实现多点触控,因为它只能从 API 5 中获得:(

除了等待 HTC 更新之外,还有其他方法可以解决这个问题吗?或者购买 2.1 手机

public boolean onTouchEvent (MotionEvent event) {
    //TODO: determine if the event object is an ACTION_POINTER_DOWN etc...

    //for ACTOIN_DOWN it is
    if(event.getAction() == MotionEvent.ACTION_DOWN) {
        //do something here.....
    }
}

Does anyone know if it's possible to use Multitouch on an Android 1.5 device?

I have a HTC Hero, and it's still running 1.5 (HTC have been a little slow on getting the 2.1 ROM out).

The Android MotionEvent documentation shows the constants (ACTION_POINTER_1_DOWN, ACTION_POINTER_1_UP.....etc...) I need to implement multitouch as only avaliable from API 5 :(

Is there a way round this other then waiting for HTC to get the update out or buying a 2.1 handset?

Code Snippet:

public boolean onTouchEvent (MotionEvent event) {
    //TODO: determine if the event object is an ACTION_POINTER_DOWN etc...

    //for ACTOIN_DOWN it is
    if(event.getAction() == MotionEvent.ACTION_DOWN) {
        //do something here.....
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

快乐很简单 2024-09-05 13:57:11

This post discusses it a bit in the context of users. It would stand to reason that if the browser supports it (I'm assuming your hero has the requisite hardware...) you as a developer could access it. That said, it's possible that it's not part of the public api but even if that's the case, you could just use reflection to call the methods. This isn't a great answer, but you could download the cupcake source from the repo and dig through the browser code to see how they implement the multitouch stuff.

葬心 2024-09-05 13:57:11

这里你有一个例子,它在我的英雄上运行良好,但是我的 onscroll 方法仍然存在问题,该方法有时会被调用,因为没有内置事件来告诉我的 Activity 我正在缩放。

here you have an example, it works fine on my Hero, but I still have issues with my onscroll method which is called sometimes, since there is no builtin events to tell my Activity I am zooming.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文