gpt4 book ai didi

java - 读取调制解调器固件版本 : Android

转载 作者:行者123 更新时间:2023-11-29 06:41:11 25 4
gpt4 key购买 nike

我正在开发一个适用于 iPhone 和 Android 的应用程序,我需要像 iPhone 开发人员那样阅读 Modem Firmware Version

我在 Internet/SO 上搜索但找不到与我的问题相关的任何内容。

是否可以在 Android 中读取 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);

所有学分转到cyanogen-updater ,来自同一项目的自定义方法 SysUtils

关于java - 读取调制解调器固件版本 : Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11796562/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com