I am able to read SMS in Android from this:-
phonesms = new ArrayList<String>();
ContentResolver cr = getContentResolver();
Uri uriSMSURI = Uri.parse("content://sms/inbox");
Cursor cur = getContentResolver().query(uriSMSURI, null, null, null,null);
startManagingCursor(cur);
if (cur.moveToFirst()) {
for (int i = 0; i < cur.getCount(); i++) {
try {
String smsbody = cur.getString(cur.getColumnIndexOrThrow("body")).toString();
phonesms.add(smsbody);
} catch (Exception e) {
}
Now Problem is that I want to access Unread SMS & send Unread SMS automatically Through Email in a time period.
I can send sms on email from two methods:-
1. Through Intent
2.Java Mail Api
But How to send unread sms automatically via Email within a fixed Time Period.
To get unread sms: