How to Determine if Android Device has Touch Screen Feature

public static final String FEATURE_TOUCHSCREEN was added in API level 8
Feature for getSystemAvailableFeatures() and hasSystemFeature(String)
The device's display has a touch screen.
Constant Value: "android.hardware.touchscreen"


1. Get a PackageManager Instance named myPackageManager.

2. Create a Boolean Variable named bolTouchScreenSupported

3. Set the Minimum and Target SDK version  to 8 or greater. 

4. In the onCreate method, add the below code. This will return the touch screen ability to a boolean named bolTouchScreenSupported. It will then display a toast displaying the touch screen ability of the device to the user.

bolTouchScreenSupported = myPackageManager.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN);
if (bolTouchScreenSupported) {
Toast.makeText(this, "Device has Touch Screen capability", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "No Touch Screen capability!", Toast.LENGTH_LONG).show();
}

5. Compile and run!