AntonioSanchez AntonioSanchez - 1 year ago 86
Android Question

Android SDK, Check if device is Amazon-FireTV

I am trying to write a simple piece of code that will execute some other code if true. What I want to do is check if my app is running on the 'Amazon Fire-TV (BOX, not the Fire-TV stick)' I think it would not be that hard to do but I am guessing it would be something like this?

String osName = android.getSystemOS();

if(!osName.equals("AMAZON FIRE-TV")){
Toast.makeText(MainActivity.class, "This app may not be compatible with your device..., Toast.LENGTH_LONG").show();


Answer Source

You can check any device name specifically using:

boolean isFireTV = Build.MODEL.equalsIgnoreCase("AFTB");

(see this page for FireTV model strings, and this one for Fire Tablets)

I'd also check out this answer for a more generic test to help you determine if your app is running on an Amazond device, or installed via the Amazon AppStore (eg on a Blackberry device)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download