0

I have a few questions about the following consts in the Build class:

MANUFACTURER, MODEL, PRODUCT, BRAND, DEVICE

  1. Is there some kind of standard for the values of the above consts?
  2. Can I count on the values to exist (not be blank) on all devices?
  3. Is there a difference between the values when the device is bought from different mobile carriers?
  4. What is the best way to identify a device type? (for example, to know that this is a Galaxy S5 bought from Verizon)? If such a way exists, is it bullet proof?
dors
  • 5,802
  • 8
  • 45
  • 71

2 Answers2

0
  1. no
  2. no
  3. possibly, but not certainly
  4. you shouldn't do that apart from statistics-making reasons

Speaking from experience, I advise you NOT TO RELY on those values. Maybe for statistics or something like displaying the device ID, but do not leave operations on them to a non-human system, as the constants tend to vary greatly.

I have seen a Kazam phone which had a Note 2 constant, for example. Not worth the headache.

Kelevandos
  • 7,024
  • 2
  • 29
  • 46
  • Thanks a lot :) Do you have a recommendation for a way to identify the device/mobile carrier? – dors Mar 02 '15 at 08:54
  • The current carrier can be extracted from the TelephonyManager (http://stackoverflow.com/questions/3838602/how-to-find-out-carriers-name-in-android) and as for the device, the constants you listed are your best bet, but again, try not to rely on them too much. It is better to categorize the devices by screen sizes, density, language etc., all this stuff Android framework provides. – Kelevandos Mar 02 '15 at 08:58
  • If you found the answer satisfying, please mark it as correct. Thanks! :-) – Kelevandos Mar 02 '15 at 09:22
0

Those are the system properties when build customized Android ROM, the ROM manufacture can change theses value based on their requirements.

As for app developer, you can retrieve these values from shell command or java code with hide API directly.

$ adb shell getprop 
or
SystemProperties.get("ro.product.model");

So, for your questions.

  1. No standard to regulate how these values should be written.
  2. Usually these values should exist on all device that follow the CTS and get the CTS certificate, this is Android device compatibility in system level. Every Android device manufacture would follow the CTS standard if they want their product used widely.
  3. It's decided by manufacture these values should be different or not for different carrier.
  4. For the use of Android app level, to identify a device, the device model is enough. App developer can get the device specifications from device model. If you need the operator information, you can use TelephoneManager to get it.

     TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
     telephonyManager.getNetworkOperator();
    
alijandro
  • 11,627
  • 2
  • 58
  • 74