发送使用SMS管理器的Andr​​oid短信群发 [英] Sending bulk sms using sms manager in android

查看:152
本文介绍了发送使用SMS管理器的Andr​​oid短信群发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发送短信近至90-100使用 SmsManager ,我读的文件编号的,并通过数sendtextmessage功能如下

号的

 的String []号; //这个数组包含手机号
SmsManager SM = Smsmanager.getDefault();
的for(int i = 0; I< nos.length;我++){
 sm.sendtextmessage(NOS [I],空,你好,NULL,NULL);
}

问题是:


  1. code正在执行,但消息没有发送,即使我有余额

  2. 我改变code使用股票手机短信的应用程序,甚至发送此也无法发送。

  3. 如果我送一对一无现货应用程序,它发送,但如果让我选择超过5则数它未发送我用HTC的浏览器。


解决方案

您code是正确的,但问题是,你是射击短信在for循环中。 for循环会同时发送短信操作需要发送下一个SMS前有延迟,以非常快的执行。

previously我已经在Java中做同一种程序,你会发现它的工作code在我的其他答案。所以,我在开发过程中我都知道,短信发送活动需要发送下一个SMS之前的时间差距。所以,我想建议你有至少做1000微延迟第二发送下一个SMS之前。

I am sending sms nearly to 90-100 number's using SmsManager, I am reading number's from file and passing the number to sendtextmessage function as below

String[] nos;// this array contains mobile nos
SmsManager sm = Smsmanager.getDefault();
for(int i=0;i<nos.length;i++){
 sm.sendtextmessage(nos[i],null,"hello",null,null);
}

problem is:

  1. Code is executing but messages are not sending, even I am having balance
  2. I changed code to use stock sms app to send even this also failed to send.
  3. if I send one to one no from stock app, it is sending but if I choose number more than 5 then it is not sending I used htc explorer.

解决方案

Your code is right but the problem is that you are firing SMS in a for loop. The for loop is going to execute very fast while Sms Sending action requires some delay before sending a next SMS.

Previously I have done same kind of program in Java, you may find it's working code in my other answer. So during my development I come to know that SMS sending activity requires a time gap before sending next SMS. So I would like to suggest you to have a delay of atleast a 1000 micro second before sending the next SMS.

这篇关于发送使用SMS管理器的Andr​​oid短信群发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆