Revision as of 10:43, 16 August 2012 by skalogir (Talk | contribs)

Getting Cell ID in Java ME

From Nokia Developer Wiki
Jump to: navigation, search

Article Metadata
Code ExampleTested with
Devices(s): Nokia 701, Nokia Asha 305
Keywords: System.getProperty(), Nokia proprietary system properties
Created: jarmlaht (14 May 2008)
Last edited: skalogir (16 Aug 2012)



This code snippet demonstrates how to get the mobile cell ID by using Nokia system properties in Series 40 and S60 devices. Note that a different system property is used to get the cell ID in Series 40 and S60 devices:

Platform Version Security Domain System property
Series 40 3rd Edition, FP1 up to Series 40 5th Edition Manufacturer / Operator
Series 40 5th Edition, FP1 up to Series 40 6th Edition FP1 Manufacturer / Operator
S60 3rd Edition, FP2 (or newer) Untrusted 3rd party
Series 40 Developer Platform 1.0 (or newer) Untrusted 3rd party

Note.pngNote: Signing in the manufacturer domain practically means that the property is inaccessible to 3rd party developers. Please ensure that your device belongs to a platform where the system property is available in the untrusted 3rd party domain


import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class CellIDMIDlet extends MIDlet implements CommandListener {
private Form form;
private Command exitCommand;
private String old_cell_id; // Old cell id property for some Series 40 devices
private String new_cell_id; // New cell id property for the latest Series 40 and Symbian devices
public void startApp() {
form = new Form("Getting Cell ID");
old_cell_id = System.getProperty("Cell-ID");
new_cell_id = System.getProperty("com.nokia.mid.cellid");
form.append("Old System Property: " + old_cell_id + "\n");
form.append("New System Property: " + new_cell_id);
exitCommand = new Command("Exit", Command.EXIT, 1);
public void pauseApp() {
public void destroyApp(boolean unconditional) {
public void commandAction(Command c, Displayable d) {
if (c == exitCommand) this.notifyDestroyed();


When the MIDlet is run in either a Series 40 or S60 device, a cell ID should be shown on the Form (one will have a numeric value and another will have 'null').

See also

Java ME System properties

269 page views in the last 30 days.