Determine if your Kindle device

I have an Android app that I would like to offer in the Amazon AppStore. My app has some location-based features and camera features that I need to disable if the user device is a Kindle. Is there a way to programmatically determine if a Kindle user device is? I know that I can create different versions for the Kindle and non-Kindle, but I thought that I would first ask if there is a way to detect this in the code.

+5
source share
4 answers

To check if the device has a specific function, you PackageManager.hasSystemFeature(String name)should be enough in your case.

, FEATURE_LOCATION FEATURE_CAMERA hasSystemFeature

, android.os.Build.MANUFACTURER android.os.Build.BRAND android.os.Build.BOARD android.os.Build.DEVICE

+12

Kindle, (Amazon) Build.MANUFACTURER Build.MODEL. Kindle , KFTT, KFOT, Kindle Fire .. . nos.

+9

Kindle Device (s)

public static boolean isKindle(){
        final String AMAZON = "Amazon";
        final String KINDLE_FIRE = "Kindle Fire";

        return (Build.MANUFACTURER.equals(AMAZON) && Build.MODEL.equals(KINDLE_FIRE) ) || Build.MODEL.startsWith("KF");
} 
+4

I know this post is old, but the approach to this is wrong. If your Kindles problem is hardware related, that is, Kindles does not have camera or camera support, you need to check the camera support, not the device type. What if other devices do not support the camera? Instead of a suggested answer try this

public static boolean isCameraAvailable(Context context) {
    PackageManager packageManager=context.getPackageManager();
    if (packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY)) {
        // this device has a camera 
        return true; 
    } else { 
        // no camera on this device 
        return false; 
    } 
} 

This is much better than detecting if the device is shameful, otherwise it makes a different kind of ignition design.

+1
source

All Articles