Detect app is running on Kindle Fire
Asked Answered
G

2

30

Does anyone know how to detect if the app is running on Kindle Fire ?

My app needs to turn off a few features if running on the Kindle Fire and I want to use the same build as Google Marketplace.

Galsworthy answered 29/11, 2011 at 10:59 Comment(0)
D
41

You can read android.os.Build.MANUFACTURER and android.os.Build.MODEL. On a Kindle Fire 1st Generation they are 'Amazon' and 'Kindle Fire' respectively. For model codes of newer Kindle Fire devices, see Device and Feature Specifications on Amazon's developer site.

Danielson answered 3/12, 2011 at 7:49 Comment(1)
also check out #19593427 to see if the apk was installed from the Amazon storeCollodion
S
38

Based on Amazon's Tablet Device Specifications I currently use this code:

public static boolean isKindleFire() {
    return android.os.Build.MANUFACTURER.equals("Amazon")
            && (android.os.Build.MODEL.equals("Kindle Fire")
                || android.os.Build.MODEL.startsWith("KF"));
}

According to that table the manufacturer string is always equal to "Amazon" and the model string is either "Kindle Fire" for the first 2011 model or it starts with "KF" for all subsequent models.

Saxony answered 11/11, 2012 at 21:36 Comment(4)
So, just had an app rejected by Amazon because it was starting the Google app store, dependent on this test. Unfortunately I don't have the failing values of Build.*, but I resubmitted with equalsIgnoreCase in place of equals for the first two parts of the expression and the resubmission passed. So that may now be necessary.Antipathetic
@Antipathetic - equalsIgnoreCase probably does not hurt but I am not convinced. Maybe they ran a test on a non-Kindle Fire device? AFAIK you can install their App Store on almost any Android device. I think you should check if Google Play is available in addition (or instead of) this test.Saxony
Yeah who knows, Amazon isn't exactly a perfect actor, they may have tested on a non-Kindle even though I am relatively sure that I explicitly disallowed distribution on them. I really should do it the way you describe, but the way the code is written it will need some reorganization to support that.Antipathetic
Why bother checking the model? I would imagine most folks just need to see if it's an Amazon device so they can alter their app to not use any Google services.Frogmouth

© 2022 - 2024 — McMap. All rights reserved.