Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Getting Cell ID in Java ME

From Wiki
Jump to: navigation, search
Article Metadata
Code ExampleTested with
Devices(s): Nokia 701, Nokia Asha 305
Created: jarmlaht (14 May 2008)
Last edited: hamishwillee (22 Jul 2013)



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("");
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

This page was last modified on 22 July 2013, at 11:41.
90 page views in the last 30 days.