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: 23
Registered: ‎08-06-2008
My Device: Not Specified

Datagram conection

Hi, i using this class for to send a sms to my application to change a value, but the server is booted up receiving a message. There any way to check that every interval time so often you have reached an sms may follow the execution of the rest of the application?
BlackBerry Development Advisor
Posts: 15,300
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: Datagram conection

I'm not sure what you are asking here.  Can you clarify your question?
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
New Developer
Posts: 23
Registered: ‎08-06-2008
My Device: Not Specified

Re: Datagram conection

[ Edited ]

Thx,

For example to recieve a sms use this code:

 

_dc = (DatagramConnection)Connector.open("sms://"); Datagram d = _dc.newDatagram(_dc.getMaximumLength()); _dc.receive(d); String address = new String(d.getAddress()); String msg = new String(d.getData()); System.out.println("Message received: " + msg); System.out.println("From: " + address);

//NEXT CODE

 

With this code creates a server that is expected to receive an sms. I would like to know if you can put a timeout to continue running the following code if once that time has not received any sms.

Message Edited by danietepa on 09-24-2008 03:21 AM
Message Edited by danietepa on 09-24-2008 03:21 AM
Highlighted
BlackBerry Development Advisor
Posts: 15,300
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: Datagram conection

There is no built in method that provides a timeout parameter when listening for SMS message.  Do you want to stop listening for incoming messages after a given time or just execute another action?  You can use a Timer and TimerTask to execute another thread after a set amount of time.  Your application could remain listening for connections this way.
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