Created
September 1, 2017 07:13
-
-
Save rajankur/380a368bf25c18a31d011f85ffb41455 to your computer and use it in GitHub Desktop.
Programatically get codename of your Android Device
This file contains 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
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