Feature for getSystemAvailableFeatures() and hasSystemFeature(String).
The device is capable of communicating with consumer IR devices.
Constant Value: "android.hardware.consumerir"
Here are some examples of Android Cell Phones with Infrared.
Constant Value: "android.hardware.consumerir"
Here are some examples of Android Cell Phones with Infrared.
1. Get a PackageManager Instance and save to myPackageManager.
2. Create a Boolean Variable named bolIRSupported.
3. Set the Minimum and Target SDK version to 19 or greater.
4. In the onCreate method, add the below code. This will return the IR ability to a boolean named bolIRSupported. It will then display a toast displaying the IR ability on the device to the user.
bolIRSupported = myPackageManager.hasSystemFeature(PackageManager.FEATURE_CONSUMER_IR);
if (bolIRSupported) {
Toast.makeText(this, "Device has IR Capability", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "No IR capability!", Toast.LENGTH_LONG).show();
}
5. Compile and run!
Resources:
http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_CONSUMER_IR
Resources:
http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_CONSUMER_IR