import Javax.microedition.io.ConnectionNotFoundException;
import Javax.microedition.midlet.*;
import Javax.microedition.lcdui.*;
public class MakeCall extends MIDlet implements CommandListener{
private Display display;
private Form mainform;
private Command cmdExit;
private Command cmdSelect;
private TextField textfIEld;
public MakeCall(){}
public void startApp(){
display=Display.getDisplay(this);
mainform=new Form("MakeCall Test");
cmdExit=new Command("Exit",Command.EXIT,7);
cmdSelect=new Command("Select",Command.SCREEN,1);
textfield=new TextField("Phone number:","",15,TextFIEld.PHONENUMBER);
mainform.append(textfIEld);
mainform.addCommand(cmdSelect);
mainform.addCommand(cmdExit);
mainform.setCommandListener(this);
display.setCurrent(mainform);
}
public void pauseApp(){
}
public void destroyApp(boolean unconditional){
}
public void commandAction(Command c,Displayable d){
if(c==cmdExit){
destroyApp(false);
notifyDestroyed();
}
if(c==cmdSelect){
String number=textfIEld.getString();
try{
this.platformRequest("tel:"+number);
}catch(ConnectionNotFoundException ex){
ex.printStackTrace();
}
}
}
}