If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

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

Reply
New Contributor
hhamaky
Posts: 8
Registered: ‎07-26-2010
My Device: Not Specified

Empty sms message

Hi,

I was trying to make an app in which we write an sms and sends it to that number 0000000000

so that i can see the incoming message in the simulator inbox and i used that code

 

MessageConnection msgConn = (MessageConnection)Connector.open("sms://"+"0000000000");
                Message msg = msgConn.newMessage(MessageConnection.TEXT_MESSAGE);
                TextMessage txtMsg = (TextMessage)msg;
                txtMsg.setPayloadText("Test Message");
                Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(txtMsg));

I successfully receive the message in inbox but i recieve it empty.

 

and when i use that code

MessageConnection msgConn = (MessageConnection)Connector.open("sms://"+"0000000000");
                Message msg = msgConn.newMessage(MessageConnection.TEXT_MESSAGE);
                TextMessage txtMsg = (TextMessage)msg;
                txtMsg.setPayloadText("Test Message");
                msgConn.send(txtMsg);

                msgConn.close();

 

nothing occurs at all.

 

I am new in java programming so would anyone please help me in this.

 

Regards

Hassan El-hamaky

Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Empty sms message

What BlackBerry Smartphone model and BlackBerry device software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.

 

If you are testing using a CDMA based BlackBerry Smartphone please refer to the following.

 

Unable to send SMS text messages using BlackBerry smartphones that operate on CDMA networks

http://supportforums.blackberry.com/t5/Java-Development/Unable-to-send-SMS-text-messages-using-Black...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.