Skip to content

Instantly share code, notes, and snippets.

@mmaitlen
Created June 29, 2014 18:36
Show Gist options
  • Select an option

  • Save mmaitlen/8bd89314cadf5401feda to your computer and use it in GitHub Desktop.

Select an option

Save mmaitlen/8bd89314cadf5401feda to your computer and use it in GitHub Desktop.
Determine Google or Amazon device
private static final String AMAZON_MANUFACTURED_DEVICE = "amazon";
private interface DeviceType {
public static final int GOOGLE_DEVICE = 1;
public static final int AMAZON_DEVICE = 2;
}
private int getDeviceType() {
int type = 0;
String manufacturer = Build.MANUFACTURER;
String model = Build.MODEL;
if (manufacturer.toLowerCase().equals(AMAZON_MANUFACTURED_DEVICE)) {
type = DeviceType.AMAZON_DEVICE;
} else {
type = DeviceType.GOOGLE_DEVICE;
}
return type;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment