I wonder how to find the exact model of a device as mentioned in the different analytics reports. Example: where to find on my device the 'herolte' of "Samsung S7 (herolte)"?
Asked
Active
Viewed 192 times
2 Answers
0
There are a lot of device properties in android.os.Build
: https://developer.android.com/reference/android/os/Build
check some of them that look suitable, like DISPLAY, BOARD, BRAND

Maxim Berezovsky
- 497
- 5
- 9
0
"herolte" can be retrieved from the ro.build.product
system property (at least for Samsung devices):
public String getProduct() {
Process p;
String product = "";
try {
p = new ProcessBuilder("/system/bin/getprop", "ro.build.product").redirectErrorStream(true).start();
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
product = line;
}
p.destroy();
} catch (IOException e) {
e.printStackTrace();
}
return product;
}
If ro.build.product
is not correct, you can run adb shell getprop
and check the name of property you want.
I'm just not sure if ro.build.product
is available for all brands. You mentioned Samsung S7.. ro.build.product
works with Samsung devices.
NOTE
I used the code from this answer to build this one

guipivoto
- 18,327
- 9
- 60
- 75