And*_*ner 1 java android android-firmware
我正在开发一个iPhone和Android应用程序,我需要阅读,Modem Firmware Version因为iPhone开发人员在他身边.
我在Internet/SO上搜索但找不到与我的问题有关的任何内容.
是否可以Modem Firmware Version在Android中阅读?如果不是什么应该相当于那?(我们读取此属性以及更多用于跟踪设备)
由于nandeesh说在Modem固件的地方使用基带版本,他没有提供他的自定义方法的任何源代码.
我做了一些RnD并得到了最终的解决方案
private static final String BASEBAND_VERSION = "gsm.version.baseband";
/**
* Returns a SystemProperty
*
* @param propName The Property to retrieve
* @return The Property, or NULL if not found
*/
public static String getSystemProperty(String propName) {
String TAG = "TEst";
String line;
BufferedReader input = null;
try {
Process p = Runtime.getRuntime().exec("getprop " + propName);
input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024);
line = input.readLine();
input.close();
}
catch (IOException ex) {
Log.e(TAG, "Unable to read sysprop " + propName, ex);
return null;
}
finally {
if (input != null) {
try {
input.close();
}
catch (IOException e) {
Log.e(TAG, "Exception while closing InputStream", e);
}
}
}
return line;
}
Run Code Online (Sandbox Code Playgroud)
并称之为
String basebandVersion = getSystemProperty(BASEBAND_VERSION);
Run Code Online (Sandbox Code Playgroud)
所有学分都归于cyanogen-updater,自定义方法取自同一个项目SysUtils
| 归档时间: |
|
| 查看次数: |
3481 次 |
| 最近记录: |