How to save SMS to inbox in android?

Standard

You can use the SMS content provider to read and write SMS messages:

ContentValues values = new ContentValues();
values.put("address", "123456789");
values.put("body", "This is a test message!");
getContentResolver().insert(Uri.parse("content://sms/inbox"), values);

also add these in manifest:

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