How to send multiple sms via an android app

Asked

Viewed 619 times

0

In my application I am trying to send several Smss, but sometimes it does not send.

smsManager.sendMultipartTextMessage (telefones.get(i), null,smsManager.divideMessage("Mensagem"), null, null);

try {
    SmsManager smsManager = SmsManager.getDefault();
    for (int i = 0; i < telefones.size(); i++) {
        smsManager.sendMultipartTextMessage(telefones.get(i), null, "foo"), null, null);
    }
} catch (Exception e) {
    e.printStackTrace();
}

I have an Arraylist with the phones , then I try to send sms to all of the vector with a for and using smsManager, more sometimes does not send , someone knows if it is a problem of this class?

  • has two lines that can be sent smsManager.sendMultipartTextMessage(phones.get(i), null, smsManager.divideMessage("The time has come! " + baby.christBeb + " is coming. Gone " + baby.maternity + "! Nass: " + bebe.namePai + " and " + bebe.nameMae + " n(App Arrived Time)"), null, null);

  • 2

    An important consideration: try to make a minimum example of code that can be used in the resolution. The logic that checks whether a baby has a father has nothing to do with the problem of texting. Avoid putting code beyond the problem as this is reason enough to close the question, okay? In this case I reduced the code in the question to be readable and contain only the relevant parts.

  • ta good , I didn’t know that I just put the part of the code that sends

  • @Ilgnerdeoliveira you can find more information by doing a [tour] :)

  • Aff pq suspended my question :/ so it is difficult to be helped here

  • 2

    Perhaps more information is missing for the staff to be able to answer. But I am reopening the question.

  • What about the mistake? Or just don’t get the message on the mobile... inside your for use tbm smsManager.divideMessage(), I don’t know how you’re passing your data but some characters sometimes gets encoded making it happen, already had this problem especially '#'.

  • even the error Lavio, just not enough , I’m already using smsManager.divideMessage() , and I simplified a little the code pq asked

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.