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 Developer
Posts: 13
Registered: ‎12-30-2008
My Device: Not Specified

how to test application is receving sms or not

hi frndz

i developed application which send as well as receive sms.but how to test receeving of sms in application.when i go for  receive sms it get freez whole application

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: how to test application is receving sms or not

You should be able to send an SMS to your own phone and successfully receive it.

 

Nobody here can hep you with "my app freezes up" without seeing some source code.

 

What method are you using to listen for SMS?

New Developer
Posts: 13
Registered: ‎12-30-2008
My Device: Not Specified

Re: how to test application is receving sms or not

hi i m using messageListener interface and using public void notifyIncomingMessage(MessageConnection mc)

private MessageConnection _mconnection;

_mconnection = (MessageConnection) Connector.open("sms://:0";

 

but my application [Message message = _mconnection.receive();]freezes on this line.

plz help me
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: how to test application is receving sms or not

[ Edited ]

MessageConnection.receive() is a blocking call. The calling thread will block until an SMS message is available.

 

You have two choices:

 

(1) implement MessageListener so that you are only performing the receive() when a message is ready to be read

(2) Start a "receive" thread that blocks on the call.

 

I assume you have carefully read the attached KB article? This shows samples of the various methods to read the SMS messages.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

 

 

 

 

Message Edited by RexDoug on 01-02-2009 09:12 AM
New Developer
Posts: 13
Registered: ‎12-30-2008
My Device: Not Specified

Re: how to test application is receving sms or not

thaks for ur reply

but still i am not able to read sms which i am sending.i tried diffrent thred but still i get freezed.can u help me to post somd code.

 

 

 

 

 

Highlighted
BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: how to test application is receving sms or not

Please have a look at the smsdemo included with the BlackBerry JDE and BlackBerry JDE Plug-in for Eclipse for an example on sending and receiving SMS messages.
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