Android MotionEvent data not available on Galaxy Tab II

Background:

I am making a small test application on Android, which simply displays on the screen all the data that the application can feel on all fingers touching the screen. This is similar to this , but for all touches instead of one. Android touch events contain a lot of data (according to this document ), including position length, orientation, pressure, size and ellipse length.

Problem:

Each MotionEvent application my application receives reports 0 (zero) for getSize (i), getTouchMajor (i) and getTouchMinor (i) for each index index i. But he reports on reasonable, non-zero values โ€‹โ€‹of position and pressure, so something is working correctly. The docs seem to suggest that this means that the hardware does not support this information, but I am skeptical about this for two reasons.

  • The device I'm testing on is the Galaxy Tab II, which, it seemed to me, was pretty bizarre. (I searched the Internet to find out if I could find a list of features supported by various Android devices for MotionEvents, but couldn't find such a list.)
  • I used the Java method InputDevice.getMotionRanges () to check if the device supports size and main / auxiliary axes, and these results show that the device supports these axes (I got size: 0.0-1.0, major / minor: 0.0-1509.437 each )

Questions:

  • Did I conclude correctly that the Galaxy Tab II supports MotionEvent functions and major / minor axes, and if so, why can't I get this data from real MotionEvents? (My code is very similar to the code above.)
  • If this tablet does not actually support these axes, can you recommend which Android tablet I could do on this, will this give me the dimensions of the MotionEvent and the length of the ellipse axis?

Thanks in advance for any help!

Edit: Colleagues testing the app on the Galaxy tab. I get all the data, and not enough. Is there a difference between settings and settings between devices? It seems very strange that the Galaxy Tab will drop from I to II ...

+4
source share
1 answer

I answered a similar question. onTouch MoitonEvent getTouchMinor and getTouchMajor alwasys - same result, why?

In our conclusions, we did not find a single device that would give different large and small lengths for an ellipse, or this could give the orientation of such an ellipse.

Most of the tested devices gave only one value, which we considered the diagonal.

+1
source

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


All Articles