Android Multitouch - 可以在模拟器中测试吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2082707/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:27:53  来源:igfitidea点击:

Android Multitouch - Possible to test in emulator?

androidandroid-emulatoremulationmulti-touch

提问by Ben Gotow

I recently discovered that the Android 2.0 SDK supports multitouch through new functions in the MotionEvent class. You can specify a pointer index when retrieving touch properties, and in cases where multiple fingers are on the screen there should be multiple pointers provided.

我最近发现 Android 2.0 SDK 通过 MotionEvent 类中的新函数支持多点触控。您可以在检索触摸属性时指定指针索引,如果屏幕上有多个手指,则应提供多个指针。

Unfortunately, I only have a G1 to test on and it's running Android 1.5 and not 2.0.

不幸的是,我只有一个 G1 可以测试,它运行的是 Android 1.5 而不是 2.0。

Is there any way to test multitouch without a 2.0 device? In the iPhone simulator, you can hold down option and shift option to perform two fingered pinch and two fingered drag, respectively. Is there any similar functionality in the Android emulator? Is it something I should expect to see in the future, or should I just suck it up and buy a new test phone?

有没有办法在没有 2.0 设备的情况下测试多点触控?在 iPhone 模拟器中,您可以按住 option 和 shift option 分别进行两指捏合和两指拖动。Android 模拟器中是否有类似的功能?这是我应该期待在未来看到的东西,还是我应该放弃并购买新的测试手机?

采纳答案by Daniel Velkov

Thisis a post by a guy from the Android team who says that multitouch in the emulator is still not supported.

是一个来自 Android 团队的人的帖子,他说模拟器中的多点触控仍然不受支持。

回答by Waza_Be

This is a postthat describes how to use multitouch from a tethered phone.

这是一篇描述如何从系留电话使用多点触控的帖子

回答by ddcruver

Yeah I don't believe the emulator has that same shortcut that the iphone one.

是的,我不相信模拟器具有与 iphone 相同的快捷方式。

In order to have true multi touch support for the emulator your Hardware must support it (HP TouchSmart .. etc.), your OS must support it (Windows 7 etc...) and Java must support it, and finally the emulator that Google provides in the SDK must support it.

为了为模拟器提供真正的多点触控支持,您的硬件必须支持它(HP TouchSmart .. 等),您的操作系统必须支持它(Windows 7 等)并且 Java 必须支持它,最后是 Google 提供的模拟器SDK 中提供的必须支持它。

So you would need to have specific hardware, the OS support is there but I don't believe java and emulator support is there.

所以你需要有特定的硬件,操作系统支持在那里,但我不相信 java 和模拟器支持在那里。

I think you just need to get a 2.0 device. It seems like the most appropriate and cheapest solution is. Also the emulator really is not that great, to slow compared to an actually device especially on user input. All touch stuff should be developed and tested on an actual device. Use the emulator for automatic testing and layouts that are not supported by your physical test device.

我认为您只需要获得 2.0 设备。似乎最合适和最便宜的解决方案是。此外,模拟器确实不是那么好,与实际设备相比,尤其是在用户输入方面速度较慢。所有触摸的东西都应该在实际设备上开发和测试。使用模拟器进行物理测试设备不支持的自动测试和布局。

只是给你一些花钱的理由;) 但现在 2.2 即将推出,所以现在很难得到一个,不知道它是否会升级到 2.2,这是一个很大的变化。

回答by Leox

I think you should buy a new test phone.

我认为你应该买一部新的测试手机。

But I only know that, only Nexus selled in Europesupport Multitouch.

但我只知道,只有在欧洲销售的Nexus支持 Multitouch。

Hope others can make the emulator support this funcionality.

希望其他人可以使模拟器支持此功能。