How to determine if a screen is capacitive or resistive on an Android device?

I am developing an application that will be slightly different depending on the type of screen. Is there any way to detect this?

+6
android touchscreen feature-detection
source share
2 answers

I have a little trick, but this requires a canvas. Just finding in motionEvent if

event.getPressure ()> 0 then is capacitive; event.getSize ()> 0, then resistive

the problem is that I do not want to use the canvas only to detect it :(

0
source share

android.content.res.Configuration contains a touchscreen value, which can be TOUCHSCREEN_STYLUS (= resistive), TOUCHSCREEN_FINGER (= capacitive), TOUCHSCREEN_NOTOUCH (= no touch screen), TOUCHSCREEN_UNDEFINED (= uh oh).

EDIT: I got Dianne'd again :) So, on the bottom line, there seems to be no way to get the real physical properties of the screen. I think your best bet is to set a parameter that allows users to switch between the two modes.

+1
source share

All Articles