read Kernel Version Raw - Android Android OS

Android examples for Android OS:OS Version

Description

read Kernel Version Raw

Demo Code

/*******************************************************************************
 * Copyright (c) 2011 MadRobot.//from   ww w.  java2  s. co m
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *  Elton Kent - initial API and implementation
 ******************************************************************************/
//package com.java2s;
import java.io.BufferedReader;
import java.io.FileReader;

public class Main {
    private static final String KERNEL_SOURCE = "/proc/version";

    private static String readKernelVersionRaw() {
        String kernelVersionRaw = null;
        try {
            BufferedReader bReader = new BufferedReader(new FileReader(
                    KERNEL_SOURCE), 256);
            try {
                kernelVersionRaw = bReader.readLine();
            } finally {
                bReader.close();
            }
        } catch (Throwable t) {
        }
        return kernelVersionRaw;
    }
}

Related Tutorials