Skip to content

Instantly share code, notes, and snippets.

@paulononaka
Created March 18, 2011 14:51
Show Gist options
  • Save paulononaka/876192 to your computer and use it in GitHub Desktop.
Save paulononaka/876192 to your computer and use it in GitHub Desktop.
Getting a system property in Android
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();
}
}
@paulononaka
Copy link
Author

It's like when you run "adb shell getprop {key}".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment