Help Center
Local Navigation
- Integrating with BlackBerry Device Software applications
- Unified search
- Device interaction support
-
Message list
- Create a new blank SMS text message
- Create a new populated text message
- Create a new blank MMS message
- Create a new blank email message
- Create a new populated email message
- Create a new blank PIN message
- Create a new populated PIN message
- Receive a message notification
- Add a listener to the message store
- Add a listener to the message store for batch updates
- Add a listener to a folder
- Retrieve the total count of unread email messages in all folders in the store
- Open a message
- Retrieving the body of an email message
- Notify a BlackBerry device application that an email message is about to be sent
- Notify a BlackBerry device application that an MMS message is about to be sent
- Notify a BlackBerry device application that an SMS message is about to be sent
- Send a message
- Reply to a message
- Forward a message
- Work with message folders
- Custom messages
- Attachments
- Calendar
- Contact list
- Task list
- Phone
- BlackBerry Browser
- Menu items
- Find more information
- Glossary
- Provide feedback
- Document revision history
- Legal notice
BlackBerry Manuals & Help
>
Developer Documentation
>
Java Development Guides and API Reference
>
Development Guide
Integration - BlackBerry Java SDK - 6.0
Create a new populated text message
Use the API items in the javax.wireless.messaging package (JSR 120).
- Import the required classes and interfaces.
import javax.microedition.io.Connector; import javax.wireless.messaging.MessageConnection; import javax.wireless.messaging.TextMessage; import net.rim.blackberry.api.invoke.Invoke; import net.rim.blackberry.api.invoke.MessageArguments;
- Create and populate a new TextMessage object.
MessageConnection mc = (MessageConnection)Connector.open("sms://"); TextMessage m = (TextMessage)mc.newMessage( MessageConnection.TEXT_MESSAGE ); m.setAddress("sms://5558888"); m.setPayloadText("An SMS message for you"); - Invoke Invoke.invokeApplication() with the following parameters:
- APP_TYPE_MESSAGES: a constant parameter
- MessageArguments: a new MessageArguments object that uses the new TextMessage object.
Invoke.invokeApplication( Invoke.APP_TYPE_MESSAGES, new MessageArguments(m) );
Next topic: Create a new blank MMS message
Previous topic: Create a new blank SMS text message