我正在开发一个在iPhone和Android中的应用程序,在那里我需要像iPhone开发人员那样阅读Modem Firmware Version。
我在网上搜索,但找不到与我的问题有关的任何东西。
Modem Firmware Version 可以在安卓系统中阅读吗?如果不是,什么应该等同于?(我们读取了这个属性和更多用于跟踪设备的内容)
发布于 2012-08-06 07:31:36
正如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);所有学分都属于氰基更新器,自定义方法是从同一个项目SysUtils中提取的。
发布于 2012-08-03 13:23:17
android上的about手机通过获取属性gsm.version.baseband来显示基带版本。您可以使用SystemProperties.get("gsm.version.baseband“、”未知“);
https://stackoverflow.com/questions/11796562
复制相似问题