Thursday, November 10, 2016

android app read build.prop




        String key = "ro.product.name";
        String prop = getProp(key);
        Log.e(TAG, key + ": [" + prop + "]");



public String getProp(String key) {
        Process p = null;
        String prop = "";
        try {
        p = new ProcessBuilder("/system/bin/getprop", key).redirectErrorStream(true).start();
        BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
        String line = "";
        while ((line=br.readLine()) != null) {
        prop = line;
        }
        p.destroy();
        } catch (IOException e) {
        e.printStackTrace();
        }
        return prop;
}

Tuesday, November 1, 2016

build android application on command line



http://incise.org/android-development-on-the-command-line.html

http://incise.org/android-development-on-the-command-line.html