2011-09-14 65 views

回答

3

只要阅读它像任何其他文件...

try { 
    BufferedReader mounts = new BufferedReader(new FileReader("/proc/stat")); 
    String line; 

    while ((line = mounts.readLine()) != null) { 
     // do some processing here 
    } 
} 
catch (FileNotFoundException e) { 
    Log.d(TAG, "Cannot find /proc/stat..."); 
} 
catch (IOException e) { 
    Log.d(TAG, "Ran into problems reading /proc/stat..."); 
} 
+0

请问手机必须扎根或任何有权限读取该文件? –