Sorry for any mistake!
I am developing an App in android in which I am access unread message from the mobile with the help of Content Resolver & Sending those message on Email automatically. I am using TimerTask for this which repeate my Application with in a specific Time which I have set. Now it again Pickup those message which I have send On Email. Now problem is that How to recognise which message i have send in android?
Any help will be appreciated.
Thanks & Regards,
Deepanker Chaudhary

Each message must have an Identifier.. so you can store list of identifier for the message that you have already sent, this way you can identify whether message is already sent or not. not much technical answer but it may help you
–
Waseem KhanOct 24 '12 at 6:21

1 Answer
1

Store the timestamp/id of the last SMS successfully forwarded through the email in a SharedPreferences value.

Maintain a database internal to your application and store all the messages forwarded to email along with their sending status in this database, so that you can resend the message in case of error in sending the email. You may have to perform housekeeping of this database to occasionally clear out past entries.

when i have 3 unread message & next time i have 4 unread message But 3 message i have sent now how i will maintain from sharedPrefence. Please Clarify. & I have never use SQLite.
–
Deepanker ChaudharyOct 24 '12 at 6:28

When you have successfully forwarded the 3 messages, store the timestamp of the latest message (one that is the most recent) in the SharedPreferences. Next time, check for this preference value and send only those messages that are more recent than this value (have higher timestamps). This solution makes assumption that the messages are delivered in the order of the timestamp, which may not be true in all cases.
–
RajeshOct 24 '12 at 6:34