Skip to content

Instantly share code, notes, and snippets.

@rajankur
Created September 1, 2017 07:13
Show Gist options
  • Save rajankur/380a368bf25c18a31d011f85ffb41455 to your computer and use it in GitHub Desktop.
Save rajankur/380a368bf25c18a31d011f85ffb41455 to your computer and use it in GitHub Desktop.
Programatically get codename of your Android Device
String value = Build.DEVICE;
try {
final Class<?> sp = Class.forName("android.os.SystemProperties");
final Method get = sp.getMethod("get", String.class);
value = (String) get.invoke(null, "ro.build.product");
Log.v("UJJ", value);
} catch (Exception ignored) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment