我正在开发一个 iPhone 和 Android 中的应用程序,我需要阅读Modem Firmware Version
正如 iPhone 开发人员在他身边所做的那样。
我在 Internet/SO 上搜索,但找不到与我的问题相关的任何内容。
是否可以阅读Modem Firmware Version
在安卓中?如果不是的话应该相当于什么?
正如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;
}
并将其称为
String basebandVersion = getSystemProperty(BASEBAND_VERSION);
所有学分都归于氰更新剂 http://code.google.com/p/cyanogen-updater/source/checkout,取自同一项目的自定义方法SysUtils http://code.google.com/p/cyanogen-updater/source/browse/trunk/src/cmupdaterapp/utils/SysUtils.java
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)