Android System Property Get getSystemProp(String key)

Here you can find the source of getSystemProp(String key)

Description

get System Prop

Declaration

public static String getSystemProp(String key) 

Method Source Code

//package com.java2s;
import java.io.BufferedReader;

import java.io.InputStreamReader;

public class Main {
    static final String LOGTAG = "Helper";

    public static String getSystemProp(String key) {
        String line = "";
        try {/*from w w w.  java  2s.co m*/
            Process ifc = Runtime.getRuntime().exec("getprop " + key);
            BufferedReader bis = new BufferedReader(new InputStreamReader(
                    ifc.getInputStream()));
            line = bis.readLine();
            ifc.destroy();

        } catch (java.io.IOException e) {
            return new String(LOGTAG);
        }

        return line;
    }
}

Related

  1. getSystemProperty(String key, String def)