Created
June 29, 2014 18:36
-
-
Save mmaitlen/8bd89314cadf5401feda to your computer and use it in GitHub Desktop.
Determine Google or Amazon device
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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