Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified
Accepted Solution

SMS to predefined Number


If I use the net.rim.blackberry.api.invoke class to invoke the messages application, I want to invoke the SMS-Application to create a text to a predefined number.

I found this here: 

MessageArguments(TextMessage textMessage)

 But don't know how to use the TextMessage Interface. Can someone give me an example for that?

Thank you! 


If your question was answered, please accept it as a sollution and / or give Kudos ;-)
Use the Search Field first! Maybe the question you want to ask already exists!
Posts: 56
Registered: ‎07-15-2008
My Device: Not Specified

Re: SMS to predefined Number

Javec, here's an example of how to use it:


private void composeSms(String address) { try { MessageConnection mc = (MessageConnection)Connector.open("sms://"); TextMessage textMessage = (TextMessage)mc.newMessage(MessageConnection.TEXT_MESSAGE); textMessage.setAddress("sms://" + address); Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(textMessage)); } catch (IOException e) { Dialog.alert(e.getMessage()); } }