Created
March 18, 2011 14:51
-
-
Save paulononaka/876192 to your computer and use it in GitHub Desktop.
Getting a system property in Android
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
public static String getPropSystem(String key) throws IOException { | |
BufferedReader bis = null; | |
try { | |
Process ifc = Runtime.getRuntime().exec("getprop " + key); | |
bis = new BufferedReader(new InputStreamReader(ifc.getInputStream())); | |
return bis.readLine(); | |
} finally { | |
bis.close(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's like when you run "adb shell getprop {key}".