首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >阅读Modem固件版本: Android

阅读Modem固件版本: Android
EN

Stack Overflow用户
提问于 2012-08-03 13:19:30
回答 2查看 4.4K关注 0票数 2

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

我在网上搜索,但找不到与我的问题有关的任何东西。

Modem Firmware Version 可以在安卓系统中阅读吗?如果不是,什么应该等同于?(我们读取了这个属性和更多用于跟踪设备的内容)

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-08-06 07:31:36

正如nandeesh所说,在Modem固件的位置使用基带版本,他没有提供任何自定义方法的源代码。

我做了一些RnD,得到了最终的解决方案

代码语言:javascript
复制
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;
    }

把它叫做

代码语言:javascript
复制
String basebandVersion = getSystemProperty(BASEBAND_VERSION);

所有学分都属于氰基更新器,自定义方法是从同一个项目SysUtils中提取的。

票数 7
EN

Stack Overflow用户

发布于 2012-08-03 13:23:17

android上的about手机通过获取属性gsm.version.baseband来显示基带版本。您可以使用SystemProperties.get("gsm.version.baseband“、”未知“);

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11796562

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档