BlackBerryForums.com : Your Number One BlackBerry Community
     

»Sponsored Links



Closed Thread
 
LinkBack Thread Tools
  (#1 (permalink)) Old
skynetchris Offline
Knows Where the Search Button Is
 
Posts: 24
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: optus
Default SMSPacketHeader recieved sms. - 06-09-2008, 10:38 PM

Hi all,

I've got an application that spawns a thread to listen for sms, this thread works fine, I want it to also decode the recieved SMS header using BB API SMSPacketHeader. The code to recieve the SMS looks somoething like:

Code:
                datagramConnection = (DatagramConnection)Connector.open("sms://"); 
                for(;;) { 
                    if ( _stop ) {
                        return; 
                    } 
                    Datagram d = datagramConnection.newDatagram(datagramConnection.getMaximumLength()); 
                    datagramConnection.receive(d);
...
So thats all fine, but now I want to look at the parameters of the sms such as ProtocolId. SMSPacketHeader from the BB API allows you to do this. I've only found one tutorial that says it's possible to use, but I can't get it to work:

Code:
                DatagramConnection smsConnection = (DatagramConnection)Connector.open("sms://:0");
                // tricky part - creating SmsAddress object
                SmsAddress destinationAddr = new SmsAddress("//:0");
This simple line for SmsAdress will cause the thread to crash saying application not responding. If I change the address for SmsAddress to listen to sms://:0 it complains/crashes. Ignore the fact its connecting to port 0 (as reccomended in BB Knowledgebase).

Any ideas?
   
Login or Register to Remove!
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright © 2004-2010 BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.