the sequence to delete messages from inbox is like this:
msgList = new ArrayList<InboundMessage>();
Service.getInstance().readMessages(msgList,
MessageClasses.ALL,gateway.getGatewayId());
At this point your ArrayList msgList will containg a list of InboundMessage
objects which you can address like this:
if (!msgList.isEmpty()) {
for (InboundMessage msg : msgList) {
Service.getInstance().deleteMessage(msg);
}
}
You can create more around this, but this is basic inbox delete
On Monday, May 14, 2012 3:43:42 PM UTC+3, Monku wrote:
>
> Hi All!! Is it posible to delet the inboxes(InboundMessage)?if yes,
> which class is incharge of deleting?
>
> On Mon, Apr 16, 2012 at 7:43 AM, Mothepu Monku
> <[email protected]<javascript:>>
> wrote:
> > Hi all!!!
> > What is actually read? I mean only the new massege or each and every
> > massege which is available in my modem? This is because i have deleted
> > all the message and re-sent the pure text massege to the modem but i get
> > the same error? So am totally frustrated.
> >
> > Thanks
> >
> > On Thu, Mar 22, 2012 at 10:46 PM, T.Delenikas
> > <[email protected]<javascript:>>
> wrote:
> >> The "String index out of range:" is usually throws when you modem/phone
> >> contains a message that cannot be read by smslib, like a vcard,
> multimedia
> >> etc.
> >>
> >>
> >> On Thursday, March 22, 2012 4:03:18 PM UTC+2, Mothepu Monku wrote:
> >>>
> >>> Hi all. Good people, there is no 1 who can even just to address me on
> >>> what to do? Am unable to read SMS from my modem. Thus it gives me
> >>> these errors:
> >>>
> >>> Now am getting:
> >>>
> >>> --------------------Configuration: <Default>--------------------
> >>> Example: Read messages from a serial gsm modem.
> >>> SMSLib: A Java API library for sending and receiving SMS via a GSM
> >>> modem or other supported gateways.
> >>> This software is distributed under the terms of the Apache v2.0
> License.
> >>> Web Site: http://smslib.org
> >>> Version: 3.5.1
> >>> log4j:WARN No appenders could be found for logger (smslib).
> >>> log4j:WARN Please initialize the log4j system properly.
> >>> >>> Gateway Status change for modem.com5, OLD: STOPPED -> NEW:
> STARTING
> >>> >>> Gateway Status change for modem.com5, OLD: STARTING -> NEW:
> STARTED
> >>> Modem Information:
> >>> Manufacturer: Manufacturer
> >>> Model: USB MODEM
> >>> Serial No: 354491022004793
> >>> SIM IMSI: ** MASKED **
> >>> Signal Level: -63 dBm
> >>> Battery Level: 0%
> >>> java.lang.StringIndexOutOfBoundsException: String index out of range:
> -7
> >>> at java.lang.String.substring(String.java:1938)
> >>> at
> >>> org.smslib.modem.ModemGateway.readMessagesPDU(ModemGateway.java:544)
> >>> at
> org.smslib.modem.ModemGateway.readMessages(ModemGateway.java:210)
> >>> at org.smslib.Service.readMessages(Service.java:500)
> >>> at org.smslib.Service.readMessages(Service.java:388)
> >>> at modem.ReadMessages.doIt(ReadMessages.java:108)
> >>> at modem.ReadMessages.main(ReadMessages.java:169)
> >>> >>> Gateway Status change for modem.com5, OLD: STARTED -> NEW:
> STOPPING
> >>> >>> Gateway Status change for modem.com5, OLD: STOPPING -> NEW:
> STOPPED
> >>> Process completed.
> >>>
> >>>
> >>> HELP ME PLEASE!!!!!!!!!!!!
> >>>
> >>> tHANKS IN ADVANCE.
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "SMSLib Discussion Group" group.
> >> To view this discussion on the web visit
> >> https://groups.google.com/d/msg/smslib/-/7k2h9BKxF-gJ.
> >> To post to this group, send email to [email protected]<javascript:>.
>
> >> To unsubscribe from this group, send email to
> >> [email protected] <javascript:>.
> >> For more options, visit this group at
> >> http://groups.google.com/group/smslib?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"SMSLib Discussion Group" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
To view this discussion on the web visit
https://groups.google.com/d/msg/smslib/-/FTXwuej1T64J.
For more options, visit https://groups.google.com/groups/opt_out.