android find pressure on screen
Asked Answered
R

3

2

I would like to roughly understand the amount of pressure the finger presses on the capacitive screen on android. My idea is to get the area covered by the finger when it is touched (maybe some extra parameters to get it more accurate, but thats the main idea).

So, is there any way to find the are covered? (for example get the number of pixels covered).

Ruse answered 16/2, 2012 at 13:55 Comment(1)
As far as I know, the touch screens do not "feel" pressure but the electrical field of the body. You might be able to find out how many pixels are covered by the finger touching the screen, but I fail to see how that would get you closer to understand the amount of pressure the finger is causing.Cari
N
6

There is only MotionEvent.getPressure() (which you probably already found). I doubt that there is something that reports how many pixel are covered by the finger.

Navelwort answered 16/2, 2012 at 13:59 Comment(0)
O
1

I do not really know but you have access to the following function :

MotionEvent e;
float press = e.getPressure(...);

press will be between 0 and 1, from 0 = no pressure, to 1 = normal pressure, however it can be more then 1...

Your thing is totally NIH... Use something that already exist ? Or maybe it doesn't cover your needs !

Ogg answered 16/2, 2012 at 13:59 Comment(0)
P
0

You can use MotionEvent.getSize() to get the normalized value (from 0 to 1) of the area of screen being pressed. This value is correlated with the number of pixels pressed.

Planogamete answered 21/12, 2015 at 10:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.