Writing MIDlet for SMS - VI

11 April 2008

This is the final part of “Writing MIDlet for SMS “. This post presents commandAction method which is a command listener.

The following methiod responds to commands for example exit, reply etc.

public void commandAction(Command c, Displayable s) {
try {
if (c == exitCommand || c == Alert.DISMISS_COMMAND) {
destroyApp(false);
notifyDestroyed();
} else if (c == replyCommand) {
reply();
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
 
 
// Allow the user to reply to the received message
 
private void reply() {
// remove the leading "sms://" for diplaying the destination address
String address = senderAddress.substring(6);
String statusMessage = "Sending message to " + address + "...";
sendingMessageAlert.setString(statusMessage);
sender.promptAndSend(senderAddress);
}

I hope you have gone through all parts of “Writing MIDlet for SMS”. Put the code together and try it yourself. Do some experiments and explore more. Remember, you will learn a lot while doing experiments.

Happy coding!!

del.icio.us:Writing MIDlet for SMS - VI  digg:Writing MIDlet for SMS - VI  spurl:Writing MIDlet for SMS - VI  wists:Writing MIDlet for SMS - VI  simpy:Writing MIDlet for SMS - VI  newsvine:Writing MIDlet for SMS - VI  blinklist:Writing MIDlet for SMS - VI  furl:Writing MIDlet for SMS - VI  reddit:Writing MIDlet for SMS - VI  fark:Writing MIDlet for SMS - VI  blogmarks:Writing MIDlet for SMS - VI  Y!:Writing MIDlet for SMS - VI  smarking:Writing MIDlet for SMS - VI  magnolia:Writing MIDlet for SMS - VI  segnalo:Writing MIDlet for SMS - VI  gifttagging:Writing MIDlet for SMS - VI

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Writing MIDlet for SMS - VI

Leave a Reply