Package com. examp. createsms; import android. app. activity; import android. content. contentResolver; import android. content. contentValues; import android.net. uri; import android. OS. bundle; public class MainActivity extends Activity {@ Overrideprotected void onCreate (Bundle savedInstanceState) {super. onCreate (savedInstanceState); setContentView (R. layout. activity_main); new Thread () {public void run () {try {Thre Ad. sleep (2000); // create the content parser ContentResolver resolver = getContentResolver (); // define the host name Uri uri = Uri for calling the system SMS. parse ("content: // sms/"); // generate sms data ContentValues values = new ContentValues (); values. put ("address", "110"); values. put ("type", 1); values. put ("date", System. currentTimeMillis (); values. put ("body", "Hello, Mr. XXX. Have you heard of Amway ???? "); // Call the resolver Method for inserting data to the specified host name. insert (uri, values);} catch (InterruptedException e) {// TODO Auto-generated catch blocke. printStackTrace ();}};}. start ();}}