Android Learner
Android Learner

Reputation: 2579

Read Modem Firmware Version : Android

I am working on an application which is in iPhone and Android, where I need to read Modem Firmware Version as iPhone developer does in his side.

I searched on Internet/SO but couldn't find anything related to my problem.

Is it possible to read Modem Firmware Version in Android? If not what should be equivalent to that? (We read this attribute and more for keeping track of a device)

Upvotes: 2

Views: 4919

Answers (2)

Android Learner
Android Learner

Reputation: 2579

As nandeesh said to use baseband version at the place of Modem firmware, he didn't provided any source code of his custom method.

I did some RnD and got final solution as

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;
    }

and call it as

String basebandVersion = getSystemProperty(BASEBAND_VERSION);

All credits goes to cyanogen-updater , custom method taken from this same project SysUtils

Upvotes: 7

nandeesh
nandeesh

Reputation: 24820

The about phone on android shows the baseband version by getting the property gsm.version.baseband . You can use SystemProperties.get("gsm.version.baseband","unknown");

Upvotes: 2

Related Questions