Hello Brian, well I fund a better solution for this problem which is delete
all SMS's from the SIM card directly on the *class InboundNotification*when
after the thread
in the interface *IInboundMessageNotification* read all the SMS's.
This is mi code *class InboundNotification*
public class InboundNotification implements IInboundMessageNotification
{
public void process(AGateway gateway, MessageTypes msgType,
InboundMessage msg)
{
if (msgType == MessageTypes.INBOUND) System.out.println(">>>
New Inbound message detected from Gateway: " + gateway.getGatewayId());
else if (msgType == MessageTypes.STATUSREPORT) System.out.
println(">>> New Inbound Status Report message detected from Gateway: " +gateway
.getGatewayId());
System.out.println(msg);
try {
Service.getInstance().deleteMessage(msg);
} catch (TimeoutException ex) {
Logger.getLogger(ReadMessages.class.getName()).log(
Level.SEVERE, null, ex);
} catch (GatewayException ex) {
Logger.getLogger(ReadMessages.class.getName()).log(
Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(ReadMessages.class.getName()).log(
Level.SEVERE, null, ex);
} catch (InterruptedException ex) {
Logger.getLogger(ReadMessages.class.getName()).log(
Level.SEVERE, null, ex);
}
}
}Enter code here...
You can see after that I print the info from the SMS the next is delete it
with Service.getInstance().deleteMessage(msg); and with that code in some
way I clean the SIM and the class only show new SMS. Greetings from Mexico
:)
--
You received this message because you are subscribed to the Google Groups
"SMSLib Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msg/smslib/-/-f_OFmxgrtcJ.
For more options, visit https://groups.google.com/groups/opt_out.