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?