Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

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 {
            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;
    }
}