Wednesday 13 November 2013

How to save SMS to INBOX in Android Programmatically


There is below code

                ContentValues values = new ContentValues();
                values.put("address", "123456789");
                values.put("body", "foo bar");
                getContentResolver().insert(Uri.parse("content://sms/inbox"), values);

you can save SMS to Sent box also just require to few change.
Replace  ("content://sms/inbox") to ("content://sms/sent").



Below Android Permissions required

    <uses-permission android:name="android.permission.READ_SMS"/>
    <uses-permission android:name="android.permission.WRITE_SMS"/>

No comments:

Post a Comment