0

I am using SmsManager to send message in my app.I am getting the message body from json data and saving it in a string and then sending sms. Here if i have message body more than 70 characters,then message is not able to send.Can anyone tell me why this problem is happening?Here is my code:

 SmsManager sms = SmsManager.getDefault();
 sms.sendTextMessage(phoneNumber, null,msg, sentPI, deliveredPI);

If I use this code message is sending as 2 separate messages after 70th character:

ArrayList<String> messageParts = sms.divideMessage(message);
        for(String part : messageParts)
        {
            sms.sendTextMessage(phoneNumber, null,part, sentPI, deliveredPI);
        }

I have tried with sendMultipartTextMessage() .But no use. What can I do here?

 private void sendSMS(final String phoneNumber, String message, final String filename){
  ArrayList<String> msgArray=sms.divideMessage(message);
        sms.sendMultipartTextMessage(phoneNo, null, msgArray, null, null);
}
user
  • 11
  • 5
  • The `sendMultipartTextMessage()` method is what you want. You'll need to show us your code for that, and describe exactly how it's failing. – Mike M. Oct 01 '16 at 06:19
  • Who is your cellular provider? From conversations I've had with other users in the past, apparently some providers just don't allow multipart messages. You might be stuck with sending single-part messages. Can you send a multipart message with another SMS app? If so, is it received as a single message, or multiple single-part messages? – Mike M. Oct 01 '16 at 06:25
  • @Mike M. I am sending SMS from Reliance Jio sim.I will try with other. – user Oct 01 '16 at 06:33

0 Answers0