The Source for Java Technology Collaboration

Home » java.net Forums » Mobile & Embedded » ME Interest

Thread: NEED HELP!! how to Display IMEI number on Java ME emulator device

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 0 Threads: [ Previous | Next ]
zai87

Posts: 4
NEED HELP!! how to Display IMEI number on Java ME emulator device
Posted: Jun 30, 2009 8:29 AM
  Click to reply to this thread Reply

Hi all..
i'm doing my final project for my degree.. the problem that i face is about displaying an IMEI number on Java ME emulator device.

i found the code from http://www.java-forums.org. but its not working though i have change some values inside System.getProperty

does anyone have an idea on this? your help will be highly appreciated dude.. thanks a lot
below is the code:


import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;


public class IMEI extends MIDlet implements CommandListener {
private Display mDisplay;
private Form mTestForm, mForm2;
private Command mCMD_EXIT,mSend;
private TextField mText,mText1,mText2, mText3;
private List implicitList;


public void startApp(){
mCMD_EXIT = new Command("Exit", Command.EXIT, 1);
mSend = new Command("Send", Command.SCREEN,1);


mText = new TextField("IMEI :", "", 15, TextField.NUMERIC);
mText1 = new TextField("Model :", "", 5, TextField.ANY);
mText2 = new TextField("County :", "", 17, TextField.INITIAL_CAPS_WORD);
mText3 = new TextField("Retail ID:", "", 10, TextField.NUMERIC);

//retrieve the IMEI and display
mText.setString(System.getProperty("phone.imei"));


mTestForm = new Form("IMEI WARRANTY");
mTestForm.addCommand(mCMD_EXIT);
mTestForm.addCommand(mSend);


mTestForm.append(mText);
mTestForm.append(mText1);
mTestForm.append(mText2);
mTestForm.append(mText3);


mTestForm.setCommandListener(this);
mDisplay = Display.getDisplay(this);
mDisplay.setCurrent(mTestForm);

}
public void commandAction(Command c, Displayable s){
if (c.getCommandType() == Command.EXIT){

notifyDestroyed();
}
else if(c == mSend){

mDisplay.setCurrent(mForm2);
mForm2.setCommandListener(this);

}

}

public void pauseApp(){

}

public void destroyApp(boolean unconditional){}
}




 XML java.net RSS