OnTouch MotionEvent getTouchMinor and getTouchMajor always have the same result, why?

Looking at the documentation, the touch major and blink touch the axis of the ellipse for the touch event. one for the length of the longest tangent dimension, and the other for the shortest touch event. like a measurement of an ellipse.

however, I tested this code for the getTouchMajor and getTouchMinor methods on several Android tablets. and he did this by putting my finger so that the surface area touching the screen would be longer in one direction, so it would not be a circle. therefore, the maximum and minimum numbers do not have to be the same.

the problem is that no matter which shape touches the area touching the screen in a touch event, it is always the same floating point number for both. the only way to do this is if the area of ​​your finger’s skin touching the screen is a circle.

so basically the two tablets for androids that I consider when touched touch the touch area, like the area with a round shape, sometimes larger or smaller, but always makes it round, is there any device that gives you a more accurate shape

The only good information I get from these functions is the total size of the touch area.

why both numbers are the same. and isn't that the right result?

if(event.getAction() == MotionEvent.ACTION_DOWN){ float x = event.getX(); float y = event.getY(); float touchMajor = event.getTouchMajor(); // major axis of ellipse touch area float touchMinor = event.getTouchMinor(); // minor axis of ellipse touch area // Toast.makeText(context, "x " + x , Toast.LENGTH_SHORT).show(); // Toast.makeText(context, "y " + y , Toast.LENGTH_SHORT).show(); Toast.makeText(context, "touchMajor " + touchMajor , Toast.LENGTH_SHORT).show(); Toast.makeText(context, "touchMinor " + touchMinor , Toast.LENGTH_SHORT).show(); 
+3
source share
1 answer

My project team and I are interested in the same thing (we posted this: Android finger detection - orientation and ellipse )

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

Now we tested: Samsung Galaxy S2, HTC One, Nexus 5 (from LG) and Nexus 7 (from Asus), Samsung Galaxy Tap3

As we tested the Samsung Galaxy Tap 3, we finally got different values ​​for getTouchMajor () and getTouchMinor (), but the joy was only brief because we found that getTouchMajor () = getTouchMinor () * 3 in any scenario, and getOrientation () is always 0, as with all other devices.

Our conclusion is that most devices do not support getTouchMajor (), getTouchMinor (). or getOrientation (). This is most likely a limitation of capacitive touch screens.

Methods such as FTIR (Frustrated Total Internal Reflection) or DI (Diffuse Illumination) -based touch surfaces that are based on image processing have shown richer tangential interaction data. But as far as we know, none of these methods is applicable in mobile technologies, and not a single handheld device uses any of them.

We were destroyed in order to understand that the possibilities with these metrics on portable devices cannot be realized.

EDIT: Recently, I found that my co-students showed that Samsung, created by Google Nexus 10 , shows an ellipse with a line of direction when you activate Input> Pointer Location in the developer settings.

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.

+3
source

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


All Articles