国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 系統(tǒng) > Android > 正文

詳解Android獲取系統(tǒng)內(nèi)核版本的方法與實(shí)現(xiàn)代碼

2019-12-12 02:23:35
字體:
供稿:網(wǎng)友

Android獲取系統(tǒng)內(nèi)核版本的方法

                這里主要實(shí)現(xiàn)獲取Android Linux 內(nèi)核的版本號(hào),網(wǎng)上關(guān)于這類文章不是很多,這里記錄下,希望能幫助到大家,

實(shí)現(xiàn)代碼:

public static String getKernelVersion() {   String kernelVersion = "";   InputStream inputStream = null;   try {     inputStream = new FileInputStream("/proc/version");   } catch (FileNotFoundException e) {     e.printStackTrace();     return kernelVersion;   }   BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream), 8 * 1024);   String info = "";   String line = "";   try {     while ((line = bufferedReader.readLine()) != null) {       info += line;     }   } catch (IOException e) {     e.printStackTrace();   } finally {     try {       bufferedReader.close();       inputStream.close();     } catch (IOException e) {       e.printStackTrace();     }   }    try {     if (info != "") {       final String keyword = "version ";       int index = info.indexOf(keyword);       line = info.substring(index + keyword.length());       index = line.indexOf(" ");       kernelVersion = line.substring(0, index);     }   } catch (IndexOutOfBoundsException e) {     e.printStackTrace();   }    return kernelVersion; } 

以上就是關(guān)于獲取Android內(nèi)核的辦法,如有疑問請(qǐng)留言或者到本站社區(qū)交流討論,共同進(jìn)步,感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 且末县| 仙游县| 四川省| 曲阜市| 长岛县| 昭觉县| 辛集市| 汉川市| 建水县| 甘孜县| 嘉黎县| 固原市| 台东县| 吴桥县| 台东县| 信丰县| 阳信县| 吉首市| 英吉沙县| 梅河口市| 大港区| 尉犁县| 赤壁市| 容城县| 宣化县| 时尚| 斗六市| 古田县| 扶余县| 安塞县| 白河县| 辽阳县| 丰镇市| 饶平县| 辽阳县| 神农架林区| 缙云县| 竹山县| 漠河县| 商洛市| 辛集市|