Feature for getSystemAvailableFeatures() and hasSystemFeature(String).
The device supports live wallpapers.
Constant Value: "android.software.live_wallpaper"
Constant Value: "android.software.live_wallpaper"
1. Get a PackageManager Instance and save to myPackageManager.
2. Create a Boolean Variable named bolLWSupported.
3. Set the Minimum and Target SDK version to 7 or greater.
4. In the onCreate method, add the below code. This will return the live wallpapers ability to a boolean named bolLWSupported. It will then display a toast displaying the live wallpapers ability on the device to the user.
bolLWSupported = myPackageManager.hasSystemFeature(PackageManager.FEATURE_LIVE_WALLPAPER);
if (bolLWSupported) {
Toast.makeText(this, "Device supports live wallpapers", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, "No live wallpapers support!", Toast.LENGTH_LONG).show();
}
5. Compile and run!
Resources:
http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_LIVE_WALLPAPER
Resources:
http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_LIVE_WALLPAPER