Created
December 24, 2017 08:01
Star
You must be signed in to star a gist
Android SystemProperties access
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
/** | |
* Java Library to access System Property Info | |
*/ | |
package uk.spiralarm; | |
import java.lang.reflect.*; | |
public class SystemInfo { | |
/** | |
* Attempt to extract selected data | |
* @return String | |
*/ | |
public String getData(String data){ | |
String result="none"; | |
try { | |
Class<?> c = Class.forName("android.os.SystemProperties"); | |
Method get = c.getMethod("get", String.class, String.class); | |
result = (String) get.invoke(c, data, "Error"); | |
return result; | |
} catch(Exception ex){ | |
return "Data Not Found"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment