我正在开发一个在 iPhone 和 Android 中的应用程序,我需要Modem Firmware Version
像 iPhone 开发人员在他身边那样阅读。
我在 Internet/SO 上进行了搜索,但找不到与我的问题相关的任何内容。
Modem Firmware Version
安卓可以阅读吗?如果不是,应该等同于什么?(我们阅读此属性和更多内容以跟踪设备)
我正在开发一个在 iPhone 和 Android 中的应用程序,我需要Modem Firmware Version
像 iPhone 开发人员在他身边那样阅读。
我在 Internet/SO 上进行了搜索,但找不到与我的问题相关的任何内容。
Modem Firmware Version
安卓可以阅读吗?如果不是,应该等同于什么?(我们阅读此属性和更多内容以跟踪设备)
正如nandeesh所说,使用基带版本代替调制解调器固件,他没有提供任何自定义方法的源代码。
我做了一些 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);
所有学分都归cyanogen-updater,来自同一个项目SysUtils的自定义方法
android 上的 about phone 通过获取属性 gsm.version.baseband 来显示基带版本。您可以使用 SystemProperties.get("gsm.version.baseband","unknown");