nitin tyagi
nitin tyagi

Reputation: 1186

How can i differentiate whether its a FireStick or FireTV

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
}

Upvotes: 1

Views: 794

Answers (2)

Grimmy
Grimmy

Reputation: 2061

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.

Upvotes: 1

TheBestBigAl
TheBestBigAl

Reputation: 1230

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.

Upvotes: 1

Related Questions