利用smsmanager实现后台发送短信示例
2014-01-11 15:53
627 查看
复制代码 代码如下:
public void sendServiceSms(Context mContext,String content) {
try {
SmsManager manager = SmsManager.getDefault();
PendingIntent sentIntent = PendingIntent.getBroadcast(mContext, 0,
new Intent(SMS_SENT_TEST_ACTION), 0);
manager.sendTextMessage("13912345670", null, content, sentIntent, null);
} catch (Exception e) {
e.printStackTrace();
}
}
public void sendServiceSms(Context mContext,String content) {
try {
SmsManager manager = SmsManager.getDefault();
PendingIntent sentIntent = PendingIntent.getBroadcast(mContext, 0,
new Intent(SMS_SENT_TEST_ACTION), 0);
manager.sendTextMessage("13912345670", null, content, sentIntent, null);
} catch (Exception e) {
e.printStackTrace();
}
}
参数说明
sendTextMessage(String destinationAddress, String scAddress, String text, PendingIntent sentIntent, PendingIntent deliveryIntent):
destinationAddress:接收方的手机号码
scAddress:发送方的手机号码
text:信息内容
sentIntent:发送是否成功的回执,
DeliveryIntent:接收是否成功的回执。
您可能感兴趣的文章:
相关文章推荐
- 【精华】C#利用Web Service实现短信发送
- [转]asp.net利用Web Service实现短信发送致手机
- 利用java实现的一个发送手机短信的小例子
- 利用Java实现SMS平台发送手机短信
- C#利用Web Service实现短信发送
- 利用python实现简单的邮件发送客户端示例
- python 实现发送手机短信验证码后台方法
- C#利用Web Service实现短信发送
- 举例说明android中SmsManager的用法---用来实现手机发送短信的功能
- 利用java实现的一个发送手机短信的小例子
- C#利用Web Service实现短信发送
- 利用js实现前后台传送Json的示例代码
- C#利用Web Service实现短信发送
- 利用java实现的一个发送手机短信的小例子
- Android入门:利用SmsManager发送短信
- iOS:实现邮件和短信发送的简单示例
- JAVA实现利用第三方平台发送短信验证码
- php利用云片网实现短信验证码功能的示例代码
- C#利用sina提供Web Service实现短信发送
- 通过.NET实现后台自动发送Email功能的代码示例