example.sms
Class SMSSend

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by example.sms.SMSSend
All Implemented Interfaces:
javax.microedition.lcdui.CommandListener

public class SMSSend
extends javax.microedition.midlet.MIDlet
implements javax.microedition.lcdui.CommandListener

An example MIDlet to send text via an SMS MessageConnection


Field Summary
(package private)  javax.microedition.lcdui.TextBox destinationAddressBox
          Area where the user enters the phone number to send the message to
(package private)  javax.microedition.lcdui.Display display
          current display.
(package private)  javax.microedition.lcdui.Alert errorMessageAlert
          Error message displayed when an invalid phone number is entered
(package private)  javax.microedition.lcdui.Command exitCommand
          user interface command for indicating Exit request.
(package private)  javax.microedition.lcdui.Command okCommand
          user interface command for proceeding to the next screen
(package private)  javax.microedition.lcdui.Displayable resumeScreen
          The last visible screen when we paused
(package private)  SMSSender sender
          Prompts for and sends the text message
(package private)  javax.microedition.lcdui.Alert sendingMessageAlert
          Alert that is displayed when a message is being sent
(package private)  java.lang.String smsPort
          The port on which we send SMS messages
 
Constructor Summary
SMSSend()
          Initialize the MIDlet with the current display object and graphical components.
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable s)
          Respond to commands, including exit
 void destroyApp(boolean unconditional)
          Destroy must cleanup everything.
 void pauseApp()
          Remember what screen is showing
 void startApp()
          startApp should return immediately to keep the dispatcher from hanging.
 
Methods inherited from class javax.microedition.midlet.MIDlet
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exitCommand

javax.microedition.lcdui.Command exitCommand
user interface command for indicating Exit request.


okCommand

javax.microedition.lcdui.Command okCommand
user interface command for proceeding to the next screen


display

javax.microedition.lcdui.Display display
current display.


smsPort

java.lang.String smsPort
The port on which we send SMS messages


destinationAddressBox

javax.microedition.lcdui.TextBox destinationAddressBox
Area where the user enters the phone number to send the message to


errorMessageAlert

javax.microedition.lcdui.Alert errorMessageAlert
Error message displayed when an invalid phone number is entered


sendingMessageAlert

javax.microedition.lcdui.Alert sendingMessageAlert
Alert that is displayed when a message is being sent


sender

SMSSender sender
Prompts for and sends the text message


resumeScreen

javax.microedition.lcdui.Displayable resumeScreen
The last visible screen when we paused

Constructor Detail

SMSSend

public SMSSend()
Initialize the MIDlet with the current display object and graphical components.

Method Detail

startApp

public void startApp()
startApp should return immediately to keep the dispatcher from hanging.

Specified by:
startApp in class javax.microedition.midlet.MIDlet

pauseApp

public void pauseApp()
Remember what screen is showing

Specified by:
pauseApp in class javax.microedition.midlet.MIDlet

destroyApp

public void destroyApp(boolean unconditional)
Destroy must cleanup everything.

Specified by:
destroyApp in class javax.microedition.midlet.MIDlet
Parameters:
unconditional - true if a forced shutdown was requested

commandAction

public void commandAction(javax.microedition.lcdui.Command c,
                          javax.microedition.lcdui.Displayable s)
Respond to commands, including exit

Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener
Parameters:
c - user interface command requested
s - screen object initiating the request