Androidでシステムのバージョン情報を取得

Javaコード:
public String[] getVersion(){
String[] version={“null","null","null","null"};
String str1 = “/proc/version";
String str2;
String[] arrayOfString;
try {
FileReader localFileReader = new FileReader(str1);
BufferedReader localBufferedReader = new BufferedReader(localFileReader, 8192);
str2 = localBufferedReader.readLine();
arrayOfString = str2.split(“\\s+");
version[0]=arrayOfString[2];//Kernelバージョン
localBufferedReader.close();
} catch (IOException e) {
}
version[1] = Build.VERSION.RELEASE;//ファームウェアのバージョン
version[2]=Build.MODEL;//規範
version[3]=Build.DISPLAY;//システムバージョン
return version;
}

Android

Posted by arkgame