Header Sep
Java Tips, Tricks & Code
My Rating Score
Login to rate page

October 2004
Getting MIDlet firmware version info and IMEI number

[Back]


Sometimes it can be really useful to determine what version of phone firmware your MIDlet is using from within the MIDlet, for example when there is a new firmware version available that have improved some aspect of the Java performance. In the code you write to take advantage of that improvement, you must begin with a check to see if it applies to the current phone's firmware. Until recently it's been hard to obtain this information, but with the birth of the new series of MIDP 2.0 phones, starting with the Sony Ericsson Z1010 and including the K700, K500, Z500 and S700/S710 series, and the Vodafone-specific F500i and V800, this can be done very easily.

On the phones mentioned above, calling the method:

System.getProperty("microedition.platform")

will return a string that look like this:

SonyEricssonK700i/R2L001

The text before "/" is the phone model, and the text after "/" is the firmware version.

You can also get the IMEI number of the phone by a similar call:

System.getProperty("com.sonyericsson.imei");

The returned string will simply be the IMEI number, such as:

  IMEI 123456-00-123456-1-00

Getting the firmware version by calling System.getProperty is also supported on the new Sony Ericsson P910 smartphone, where the calls return the Organizer software version. However, to get the IMEI number on the P910, you have to use the string "com.sonyericsson.IMEI, i.e. capital letters in "IMEI.

The calls will not return anything if the parameter passed isn't supported by the phone, for example if you try to get the IMEI number from a T610.

 

My Rating Score
Login to rate page