Android Finger Detection - Orientation and Ellipse

I was looking for a way to determine the orientation of a finger along with simplifying the ellipse-shaped touch area when using a mobile touch device. I chose Android, not iOS, as I found three useful methods ( getTouchMajor () , getTouchMinor (), and getOrientation () ) in the Android help system for the MotionEvent class . But I tried to implement these three methods in my application, and, unfortunately, they do not return the desired values. The orientation remains at 0, despite the fact that getTouchMajor and getTouchMinor are the same each time.

So my question is: am I doing something wrong or are these methods not yet implemented?

(I tried the features on several different devices, including the Nexus 5, Nexus 7, and HTC One)

+3
source share
2 answers

As we work together, I know that you know this answer, but I just wanted to express it so that other Stackoverflow users could use it as well.

We found suggestive remarks that perhaps touch screen drivers for most devices do not provide this data to the system.

We initially tested: Samsung Galaxy S2, HTC One, Nexus 5 (from LG) and Nexus 7 (from Asus), Samsung Galaxy Tap 3.

Unlike others, Samsung Galaxy Tap 3 gave different values โ€‹โ€‹for getTouchMajor () and getTouchMinor (), but this connection was visible getTouchMajor () = getTouchMinor () * 3, and getOrientation () is always 0, since with all other devices.

After about 2 months, we found that Google Nexus 10 can show an ellipse with a line of direction when you activate Input: Pointer Location in the developerโ€™s settings.

The initial conclusion was that most devices do not support getTouchMajor (), getTouchMinor (). or getOrientation (), which may be a limitation of capacitive touch screens. But seeing the Nexus 10 , and tracking the ellipse and orientation gives hope for a new interaction design.

This indicates that some devices deliver to getTouchMinor and getTouchMajor, as well as orientation. (or historical versions of the same functions). I did not have the ability to encode anything for the device, but that seems plausible.

+2
source

I met the same problem. Thanks for your reply, and that helps a lot. Then I tested my program on 4 Android devices: Nexus 5, Galaxy Note 8, Galaxy Tab S and Pixel 3 XL.

Here are my results: getTouchMajor () is not accurate: I cannot get the actual value of the length of the touch area

0
source

Source: https://habr.com/ru/post/1416643/


All Articles