Issue
I want to have acces to all the SMS messages available on the Android phone and store them in a SQLITE data base , but the only solution found was using BroadcastReceiver (which is not what i am looking for).
Solution
I found the solution, using ContentResolver which returns a cursor of type ICursor.
Here is the code :
Android.Database.ICursor cursor = ContentResolver.Query(uri, null, null, null,null);
StringBuilder stri = new StringBuilder("");
while(cursor.MoveToNext())
{
stri.Append(cursor.GetString(0));
//Do what ever you want
}
Note that:
uri =Android.Net.Uri.Parse("content://sms/inbox")
Answered By - Riad Rekab
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.