Uri uriSMSURI = Uri.parse("content://sms/inbox");
Cursor cur = getContentResolver().query(uriSMSURI, null, null, null,null);
int i=0;
while (cur.moveToNext()) {
Phone_no=cur.getString(2);
Time=cur.getLong(4);
Message_body=cur.getString(11);
Date dateObj = new Date(Time);
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd:HH:mm:ss");
String Timenew = df.format(dateObj);
Log.d(Tag,"INSIDE OF READ SMS INBOX");
service.setClass(getBaseContext(), Background_Service.class);
service.putExtra("Phone_no", Phone_no);
service.putExtra("Message_body", Message_body);
service.putExtra("Timenew", Timenew);
getBaseContext().startService(service);
}
the above code read the message from the inbox. And i send those message to the service for further processing. Is this the right way to do. Should i create a queue for the service execution, if so how to create, implement a queue to the above code.