Android 设备对压力敏感度的支持程度如何?

发布于 2024-11-04 23:56:13 字数 482 浏览 0 评论 0原文

我想编写一个应用程序,对用户手指施加的压力做出反应。具体来说,我想用它来改变所绘制线条的粗细。我很高兴能够对手指触摸屏幕的表面积做出反应。

MotionEvent.getSize() 和 MotionEvent.getPressure() 函数看起来正是我想要的,但没有提及它们的准确性或它们的返回值的含义。在大多数 Android 设备上,这些方法的返回值是否足够准确以满足我的需求?

我很好奇为什么没有流行的 Android 应用程序利用压力敏感度。我发现很少有文章提到这些方法,并且只遇到过讨论设备特定错误的帖子: http://groups.google.com/group/android-porting/browse_thread /线程/7e8b1bb77dc7d82d

I want to write an app that reacts to how much pressure is applied from the user's finger. Specifically, I want to use this to vary the thickness of a line being drawn. I'm happy with just reacting to the surface area of the finger applied to the screen.

The MotionEvent.getSize() and MotionEvent.getPressure() functions seem exactly what I want but mention nothing about their accuracy or what their return values mean. Are the return values from these method accurate enough on most Android devices for my needs?

I'm curious why there are no popular Android apps that make use of pressure sensitivity. I've found very few articles that mention these methods and have only come across posts that discuss device specific bugs:
http://groups.google.com/group/android-porting/browse_thread/thread/7e8b1bb77dc7d82d

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

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

发布评论

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

评论(2

明天过后 2024-11-11 23:56:13

请注意,电容式触摸屏实际上并不直接测量压力;而是测量压力。一般来说,他们报告的压力信息是根据尺寸以某种方式计算的(因为用力推动手指往往会导致更多的手指触摸屏幕)。

您绝对不能假设将报告特定设备的压力或尺寸。此外,对于压力而言,其与用户按下的实际压力之间的关系在设备之间会存在很大差异。对于生产质量的东西,您将希望您的应用程序能够根据正在运行的任何设备上接收的数据进行自我调整。

Note that capacitive touch screens don't actually directly measure pressure; generally the pressure information they report is computed in some way based on the size (since pushing your finger harder will tend to cause more of it to touch the screen).

You definitely can't assume that either pressure or size will be reported for a particular device. Also, for pressure, the relationship between this and the actual pressure the user is pressing is going to vary widely between the devices. For something production-quality, you will want your application to be able to adjust itself to the data it is receiving on whatever device it is running.

2024-11-11 23:56:13

您可以在名为 Markers 的项目中找到有用的信息。在 Eclair 之后,压力检测已经以某种方式在电容屏中可用。

You will find useful information here in a project named Markers. Pressure detection has been available somehow in capacitive screens after Eclair.

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