1

I am working on an app that will be run on an Amazon FireTV. Is there any API so that i can differentiate whether its a FireTV or FireStick. like

String model = android.os.Build.Modal;
if (model.equals("FireTV")) {
    // do something
} else if (model.equals("FireStick")){
    // do something else
}
miken32
  • 42,008
  • 16
  • 111
  • 154
nitin tyagi
  • 1,176
  • 1
  • 19
  • 52

2 Answers2

1

You can check the Model name:

public String MODELNAME = android.os.Build.MODEL;

public boolean ISFIRETV = MODELNAME.equalsIgnoreCase("AFT*");
public boolean ISFIRETVSTICK = MODELNAME.equalsIgnoreCase("AFTM");

All Fire TV devices have a model name which starts with "AFT":

FireTV (2nd Gen) is "AFTS"
FireTV (1st Gen) is "AFTB"
FireTV Stick is "AFTM".

ISFIRETV can then be used to ensure that it is a FireTV device of any kind (and not for instance sideloaded onto a non-Fire TV device), and then ISFIRETVSTICK can be used to specifically check if it is a FireStick or not.

TheBestBigAl
  • 1,231
  • 1
  • 16
  • 42
  • @TheBestBidAl thanks for the response. I have some doubts. As i read at amazon portal they highly recomened to use AFT* for checking the Fire TV because in future it can be change. is AFTM fix for FireStick ? – nitin tyagi May 02 '16 at 06:28
  • At the moment I believe there is only 1 model of FireStick, and they should all use AFTM. In future they could add another one, so you would need to take this into account. I use AFT* to check if it is any type of FireTV or FireStick (as opposed to a Kindle or other device), and then AFTM to specifically check if it is a FireStick. – TheBestBigAl May 25 '16 at 12:49
1

Besides of answer below there is one more way to check it:

final String AMAZON_FEATURE_FIRE_TV = "amazon.hardware.fire_tv";

if (getPackageManager().hasSystemFeature(AMAZON_FEATURE_FIRE_TV)) {
   Log.v(TAG, "Yes, this is a Fire TV device.");
} else {
  Log.v(TAG, "No, this is not a Fire TV device.");
}

According to documentation this is the recommended way. But to use it you should have a Context.

Grimmy
  • 2,041
  • 1
  • 17
  • 26