I dont know how to implement the queue messaging in smslib, I receive a new sms and I store in a database table, I make some logic and then I produce a new sms, I already archieve this -synchronous way, but I dont know how to do it in asynchronous way?? can someone guide me or maybe a hint, I see the docs but I dont know how to make the queue since I am receving and sending sms???, I need to run this app and I want that every user gets an answer, for example I use the method Service.getInstance().queueMessage(msg); but It did the same as Service.getInstance.sendMessage(), so my question is how to use the queue in smslib??
can someone guide me on this??
The
sendMessage()
andqueueMessage()
methods both send the messages through your modem, but there is fundamental difference;sendMessage()
does it synchronously andqueueMessage()
does is asynchronously (as you said yourself).This means that
sendMessage()
will basically forward the message to the modem, block it until the message is sent, and then return. If you however are using thequeueMessage()
method, it will store the message in a queue and the send it "when it can", without blocking the modem.To get the send status from this message (if it was sent or not, any errors etc) you need to make a class that implements the
IOutboundMessageNotification
interface. There, in theprocess
method, you get the status message and you can handle it according to you own implementation.You set you service to "listen" to these notifications using
Service.getInstance().setOutboundMessageNotification(outboundMessageNotification);
. The same applies if you want to listen to incoming messages usingIInboundMessageNotification
.Hope it helped
-Rob