Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send the SMS more than 160 character?

Tags:

android

sms

How to send big SMS in android. I used :

SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage(contactNos[j], null,msgs[i], sentPI, deliveredPI); 

this code work only for 160 character message. i also use

ArrayList<String> msgsplit=sms.divideMessage(msgs[i]); ArrayList<PendingIntent> listOfIntents = new ArrayList<PendingIntent>();   for (int k=0; k < msgsplit.size(); k++){       Intent sentIntent = new Intent();      PendingIntent pi = PendingIntent.getBroadcast(MultipleMsg.this, 0, sentIntent, PendingIntent.FLAG_CANCEL_CURRENT);       listOfIntents.add(pi);   } // sendMessage(contactNos[j],msgs[i]); sms.sendMultipartTextMessage(contactNos[j],null,msgsplit, listOfIntents, null); 

But it sends junk character in the message. Can anyone help me?

like image 538
Girish Bhutiya Avatar asked Jul 05 '11 09:07

Girish Bhutiya


People also ask

Is SMS still limited to 160 characters?

The character limit for a single SMS message is technically 160 characters. However, most modern phones and networks support message concatenation: they split large messages into individual SMS messages (called "segments") and then re-create the large message at the receiving end.

How can I increase my SMS limit?

To avoid this limit, the easiest way is to install SMS Expansion Packs. There are 29 SMS Expansion Packs, each allowing Telerivet Gateway to send an additional 100 SMS messages per hour (on older versions of Android) or 30 SMS messages per 30 minutes (on newer versions of Android).

Is MMS limited to 160 characters?

Difference: Character Limit Another thing separating MMS and SMS is the character count. SMS messages can have up to 160 characters — 70 with an emoji. As for MMS messages, they can have 1600 characters.

How many words is 160 characters?

Answer: 160 characters is between 22 words and 40 words with spaces included in the character count.


2 Answers

Try below code might help

SmsManager sms = SmsManager.getDefault(); ArrayList<String> parts = sms.divideMessage(message); sms.sendMultipartTextMessage(phoneNumber, null, parts, null, null); 
like image 198
ingsaurabh Avatar answered Oct 12 '22 00:10

ingsaurabh


Junk characters? method sendMultipartTextMessage only send text message. If you want to send non text message, you should look to method sendDataMessage. Below is the code excerpt from android cts. It has example on how to send long messages.

SmsManager sm = SmsManager.getDefault(); ArrayList<String> parts =sm.divideMessage(LONG_TEXT); int numParts = parts.size();  ArrayList<PendingIntent> sentIntents = new ArrayList<PendingIntent>(); ArrayList<PendingIntent> deliveryIntents = new ArrayList<PendingIntent>();  for (int i = 0; i < numParts; i++) { sentIntents.add(PendingIntent.getBroadcast(getContext(), 0, mSendIntent, 0)); deliveryIntents.add(PendingIntent.getBroadcast(getContext(), 0, mDeliveryIntent, 0)); }  sm.sendMultiPartTextMessage(mDestAddr,null, parts, sentIntents, deliveryIntents) 
like image 27
Jasonw Avatar answered Oct 12 '22 00:10

Jasonw