D5848: Add support for sending and receiving SMSes longer than 160 characters

Albert Vaca Cintora noreply at phabricator.kde.org
Sun May 14 10:12:28 UTC 2017


albertvaka requested changes to this revision.
albertvaka added a comment.
This revision now requires changes to proceed.


  Thanks for the patch! This was something really missing in KDE Connect :)
  
  If you fix the small issue I commented inline, the rest looks good to me.

INLINE COMMENTS

> TelepathyPlugin.java:74
> +                // If the SMS is too long, it must be sent as a multi-part message
> +                if (sms.length() > SINGLE_SMS_MAX_LENGTH)
> +                {

SMS lenght is more difficult to calculate than just checking the length of the string: it depends on the encoding used and the size of each specific character in that encoding (see [1]).

Luckily enough, looks like there is a really easy solution. We can just always call smsManager.divideMessage and then smsManager.sendMultipartTextMessage regardless of the size and number of parts. Viewing the source code from Android [2], it looks like sendMultipartTextMessage handles correctly the case of short SMS that fit in a single message.

[1] https://messente.com/documentation/tools/sms-length-calculator
[2] https://android.googlesource.com/platform/frameworks/opt/telephony/+/4931e2c/src/java/android/telephony/SmsManager.java#178

REPOSITORY
  R225 KDE Connect - Android application

REVISION DETAIL
  https://phabricator.kde.org/D5848

To: sredman, #kde_connect, albertvaka
Cc: albertvaka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20170514/92ec1fee/attachment.html>


More information about the KDEConnect mailing list