Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identify if device is Kindle

Tags:

android

kindle

I have an Android app I'd like to offer on the Amazon's AppStore. My app has some location-based features and camera features which I need to disable if the user's device is a Kindle. Is there a way to programmatically detect if a user's Device is a Kindle? I'm aware I can build different versions for Kindle and non-Kindle but I thought I'd first ask if there's a way to detect this in code.

like image 268
Pierre Rymiortz Avatar asked Feb 09 '13 08:02

Pierre Rymiortz


4 Answers

To check if the device has a certain feature, you PackageManager.hasSystemFeature(String name) which should be sufficient in your case.

To check for location and camera you can use FEATURE_LOCATION and FEATURE_CAMERA as argument to hasSystemFeature

If you still need to know the hardware of your device, you can check android.os.Build.MANUFACTURER android.os.Build.BRAND android.os.Build.BOARD android.os.Build.DEVICE

like image 188
iTech Avatar answered Oct 01 '22 17:10

iTech


If you want to detect Kindle, check for manufacturer (Amazon) using Build.MANUFACTURER and model using Build.MODEL. The value of model in case of Kindle will vary, it can be KFTT, KFOT, Kindle Fire, etc. See this for model nos.

like image 22
Abhishek Nandi Avatar answered Oct 01 '22 16:10

Abhishek Nandi


You can use this method in identifying a 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");
} 
like image 23
neferpitou Avatar answered Oct 01 '22 18:10

neferpitou


I know that this post is old, but the approach to this is wrong. If your concern with Kindles is hardware related i.e. Kindles do not have a camera or camera support then you need to check for camera support not device type. What if other devices do not offer camera support? Instead of 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 for if device is a kindle, otherwise do another build specific for kindle.

like image 27
portfoliobuilder Avatar answered Oct 01 '22 17:10

portfoliobuilder