I am working on Android application about SMS.I need some suggestion from the master. Now i am trying to read sms with this code block :
private String readSMS(){
Uri SmsUri=Uri.parse("content://sms/inbox");
String[] projection=new String[]{"_id","address","body","date"};
Cursor cursor=null;
cursor=getContentResolver().query(SmsUri,projection,null,null,null);
if(cursor!=null&&cursor.moveToFirst()){
int id=cursor.getInt(cursor.getColumnIndex("_id"));
String address=cursor.getString(cursor.getColumnIndex("address"));
String body=cursor.getString(cursor.getColumnIndex("body"));
return body;
}
return "";
}
Now I want to ask a question. Can i write a layer to manage SMS. For example i want to read SMS before user recognize it. I will use this sms if i want and show in my program else i will do nothing and Orginal phone SMS app will take it and report user by a notification.
This is what i mean :
Thank you.