SMSDemo ApplicationJava™ 2 Platform, Micro Edition, Wireless Toolkit
|
The SMSDemo application is an example MIDlet suite that demonstrates SMS and CBS features. You can use the source code of the demo as an example for your own messaging applications. The application also uses push functionality if run in OTA Provisioning mode. Push registration entries are included in the demo's MIDlet attributes. You can view the Project Settings dialog box for example values.
You can use the SMS demo application as a tutorial for using the WMA console to send and receive SMS messages. This walk through demonstrates messaging output in the WMA console and the emulated device. The demo uses the MIDP 2.0 push feature to register itself to be awoken automatically when the device receives a message. You must run the application with OTA Provisioning if you want to use the push features of the demo.
To run the SMSDemo application, follow these steps:
The SMSDemo application is best experienced when run in OTA provisioning mode (the push registries are created for you). The default emulated device opens with the AMS splash screen displayed.
The initial installation of the SMS Demo is a multi-task step:
A URL address for the demo is provided for you to install from:
Fig 1. SMSDemo URL
Installation of the SMSDemo application is now complete.
The WMA console window opens displaying its phone number.
The number is displayed in the console's output window. You can enter the number from the keyboard or by using the keypad on the emulated device. Type the phone number as one continuous string. The device will automatically place a space in the phone number.
The Hello message appears in the WMA console window along with the SMS address of the sender and the port number on which the message was received.
The message, "How are you?", appears in the device's display screen:
Fig 5. Device Display Screen Showing Reply
The device also shows the address of the sender.
The device used the push functionality and launched the SMSReceive MIDlet in response to receiving an SMS communication on the URL registered to this MIDlet: sms://:50000.
Output on the device screen states that a message is being sent.
The WMA console displays the message it received:
Fig 6. WMA Console Showing New Message
You can run the SMSDemo again, this time to send a CBS message:
Both emulated devices receive the bradcasted message and the push functionality launches the CBSReceive MIDlet to display the message. The WMA Console also displays the received message.
Copyright © 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.