Android中发送短信和彩信
发送短信:
String body="this is sms demo"; Intent mmsintent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("smsto", number, null)); mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body); mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, true); mmsintent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, true); startActivity(mmsintent);
发送彩信:
StringBuilder sb = new StringBuilder(); sb.append("file://"); sb.append(fd.getAbsoluteFile()); Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mmsto", number, null)); // Below extra datas are all optional. intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_SUBJECT, subject); intent.putExtra(Messaging.KEY_ACTION_SENDTO_MESSAGE_BODY, body); intent.putExtra(Messaging.KEY_ACTION_SENDTO_CONTENT_URI, sb.toString()); intent.putExtra(Messaging.KEY_ACTION_SENDTO_COMPOSE_MODE, composeMode); intent.putExtra(Messaging.KEY_ACTION_SENDTO_EXIT_ON_SENT, exitOnSent); startActivity(intent);
更多相关文章
- android中用socket 接收服务器的消息
- android 定时发送短信实现
- Androidの发送Email
- android 发送邮件
- android 广播传参数
- Android与Java AIO实现简单Echo服务器与客户端
- android 向serverGet和Post请求的两种方式,android向server发送
- Android(安卓)BroadcastReceiver介绍
- A20红外遥控器与Android功能的适配