Sending bulk sms using sms manager in android

你离开我真会死。 提交于 2019-12-13 13:01:10

问题


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.

回答1:


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.



来源:https://stackoverflow.com/questions/20999876/sending-bulk-sms-using-sms-manager-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!