One SMS maximum number of characters, and how many characters are processed by MMS

Source: Internet
Author: User
Tags processing text

One SMS maximum number of characters, and how many characters are processed by MMS

The number of SMS characters in the QRD8939_210102 platform is more than 20 SMS will be converted to MMS processing.

-----------------------------------------

In Android\frameworks\opt\telephony

Com.android.internal.telephony.gsm.SmsMessage

Code-->encoding_7bit
/** the maximum number of payload septets per message */
public static final int max_user_data_septets =; Single message 160 bytes (plain English characters corresponding to ASCII code)

/**
* The maximum number of payload septets per message if a user data header
* Is present. This assumes the header is only contains the
* concatenated_8_bit_reference element.
*/
public static final int max_user_data_septets_with_header = 153;//for ASCII code, the length of each text message in the long and short letter is 153 bytes, 7 bytes Mark paging information and other protocols

For pure English, 1 characters occupy 1 bytes
So the equivalent of the first 160 characters
The second 160-7-7=146 character (the protocol information of the first message also takes up the length of the second one)
Article three and above, 160-7 = 153 characters.
-----------------------------------------------------------------------

Encoding-->encoding_16bit (processing text messages that contain non-ASSICC characters such as Chinese)
/** the maximum number of payload bytes per message */
public static final int max_user_data_bytes = 140;//Single Information 140 bytes (information containing non-ASCII characters such as Chinese)


/**
* The maximum number of payload bytes per message if a user data header
* Is present. This assumes the header is only contains the
* concatenated_8_bit_reference element.
*/
public static final int max_user_data_bytes_with_header = 134;//contains information about non-ASCII characters such as Chinese, long and short letters each with a maximum length of 140-6 = 134 bytes, and 6 bytes for paging information

For information containing Chinese characters, 1 characters occupy 2 bytes, 140/2=70, 134/2=67, 6/2=3
So the equivalent of the first 70 characters
The second 70-3-3=64 character (the paging information of the first message also takes up the length of the second)
Article III and above 70-3 = 67 characters.

Long and short letter organization structure. UDH (User Data header)
Http://wenku.baidu.com/link?url=ksdB3TkIqKdm7tASZWqmZ8BJcUDbTbVw5FDWButs8pDlEM0ZuiJ7z36Z6lQDqZBA9vI-_ Xe1uwbvkrzqdecy6wfk8labqsqikzgqaz7sznk


There is no limit to the number of characters that can be entered, and if you keep typing characters, the number of characters is up to hundreds of messages, and there is a problem with low-memory phones.
Then we do a basic limit, the number of characters of 40 messages as the upper limit (because the 20 message becomes a multimedia message)
Increase the number of input characters in Mtexteditorwatcher
 Public voidaftertextchanged (Editable s) {//-----------------Add by Antoon                  if(feature_mms_message_count_limit) {int[] Params=smsmessage.calculatelength (Mtexteditor.gettext (),false); intLength = 0; if(params[3]==smsmessage.encoding_7bit) {Length= en_encode_max_length; //Modified by Antoon}Else if(Params[3] = =smsmessage.encoding_16bit) {                     //Modified by AntoonLength = ch_encode_max_length; }                 if(Mtexteditor.gettext (). Length () >length) {s=s.delete (length, s.length ());                 Toast (r.string.textcontentlimit); }            } //----------------End }

en_encode_max_length= 3060*2;  //Add by Antoon
Ch_encode_max_length //add by Antoon
Feature_mms_message_count_limit //add by Antoon





One SMS maximum number of characters, and how many characters are processed by MMS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.