Reputation: 1120
I am trying to send SMS from android application. But because its length size I didn't know how many SMS can send in multi part. I just know 7-bit we can send 160 length and 8-bit 140 length and for 16-bit it is 70 length. But I need how I can know before sending SMS that is crossing its current length so I can restrict user to enter more than its limit.
Upvotes: 2
Views: 472
Reputation: 95636
You can call SmsManager.divideMessage()
to determine if the message will need to be split into multiple parts:
SmsManager manager = SmsManager.getDefault();
ArrayList<String> messageParts = manager.divideMessage(smsMessage);
if (messageParts.size() > 1) {
... Message must be sent as more than one SMS
}
Upvotes: 1