4

Is there any way to check if an Android device (phone) has Touchscreen support or not?

So if device has touchscreen I can fire a method where the user can choose something via touch, and if not then he can choose via hardware button input...

belosand
  • 129
  • 3
  • 14

1 Answers1

6

you could try something like this

getPackageManager().hasSystemFeature("android.hardware.touchscreen");

but that's been stated to not always work, specifically when a device is connected to a tv or other screen through hdmi, since it deals with the android player itself and not the connected device, but it should work for your needs.

Community
  • 1
  • 1
trippedout
  • 1,561
  • 13
  • 20
  • 2
    As long as you rely on the device itself it works, it cannot detect external displays which is pretty obvious. – Daniel Nov 05 '13 at 14:37