android 发送短信sms

 
1 发送短信的方法:
PendingIntent mpi = PendingIntent.getBroadcast(SendSMSActivity.this, 0,
    new Intent(), 0);
  SmsManager smsManager = SmsManager.getDefault();
  smsManager.sendTextMessage(num, null, smsContent, mpi, null);

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

如果你想把短信内容保存在收件箱里面 那么只要吧uri改成:
"content://sms/inbox".

3.
Intent sendIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("sms://"));
sendIntent.putExtra("address", "123456789");
sendIntent.putExtra("sms_body", "foo bar");
startActivity(sendIntent);

你可能感兴趣的:(android 发送短信sms)