Send multi-part SMS
来源:互联网 发布:淘宝货到付款拒收后果 编辑:程序博客网 时间:2024/05/21 21:44
It is the source code from Froyo, made small change.
SmsManager smsManager = SmsManager.getDefault(); ArrayList<String> messages = null; messages = smsManager.divideMessage(content); int messageCount = messages.size(); ArrayList<PendingIntent> sentIntents = new ArrayList<PendingIntent>(messageCount); for (int i = 0; i < messageCount; i++) { PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_SENT), 0); sentIntents.add(pendingIntent); } // When the SMS has been sent mHadRegisteredSmsReceiver = true; registerReceiver(mSmsReciever, new IntentFilter(ACTION_SENT)); try { smsManager.sendMultipartTextMessage(Const.REGISTER_CENTER_SMS_NUMBER, null, messages, sentIntents, null); } catch (Exception e) { com.jsecode.police.util.LogUtil.logException(TAG, e); }
/** Broadcast receiver for SMS sending result * Remove the "First run" flag when SMS send successfully * */ private BroadcastReceiver mSmsReciever = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { switch (getResultCode()) { case Activity.RESULT_OK: // Here we are successfully run application and registered Preferences.setFirstRunFlag(false); break; default: break; } } };
- Send multi-part SMS
- WinCE SMS Send
- Send an SMS to yourself
- android sms function send function
- [Windows] MBN send SMS pdu
- [IPhone] Send SMS sample with IPhone
- How to send sms by .net
- use AT command to send a sms in linux system
- sms send命令向Android模拟器发短信
- Send SMS with GSM Modem - CMS Error codes
- sms send命令向Android模拟器发短信
- 通过sms send命令向Android模拟器发短信
- How To Send SMS Text Message in iPhone Apps
- Multi-line/Autoresizing UITextView similar to SMS-app
- AFNetWorking POST Multi-Part Request 上传图片
- android上实现multi-part上传
- S3 Multi Part Upload 中断后续传
- SMS
- VC++更改工程名称
- Java实现在线用户显示
- JSF入门
- Struts2 文件上传文件类型allowedTypes汇总
- 五分钟精通Oracle Hints
- Send multi-part SMS
- 文件操作
- 自fstab文件挂载文件系统
- 剖析RedHat Linux中三个重要内核文件
- Linux加载 hello world模块
- GLSL实现HDR Rendering
- transformby的简单用法
- VIM的使用指南(个人总结)
- VS设置多个条件编译符号