How to Determine if Android Device Supports Landscape Orientation

public static final String FEATURE_SCREEN_LANDSCAPE was added in API level 13
Feature for getSystemAvailableFeatures() and hasSystemFeature(String).
The device supports landscape orientation screens. For backwards compatibility, you can assume that if neither this norFEATURE_SCREEN_PORTRAIT is set then the device supports both portrait and landscape.
Constant Value: "android.hardware.screen.landscape"


1. Get a PackageManager Instance named myPackageManager.

2. Create a Boolean Variable named bolLandscapeSupported

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

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

bolLandscapeSupported = myPackageManager.hasSystemFeature(PackageManager.FEATURE_SCREEN_LANDSCAPE);
if (bolLandscapeSupported) {
Toast.makeText(this, "Device supports landscape orientation screens", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "Device does NOT support landscape orientation screens!", Toast.LENGTH_LONG).show();
}

5. Compile and run!

Resources:
http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_SCREEN_LANDSCAPE