From 05a9ad60bda4c1a5cc50b563caa4fa2336268095 Mon Sep 17 00:00:00 2001 From: Zepp Lu Date: Mon, 26 Sep 2016 00:15:12 +0800 Subject: [PATCH] now able to send message longer than the maximum size --- app/src/main/java/com/termux/api/SmsSendAPI.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/termux/api/SmsSendAPI.java b/app/src/main/java/com/termux/api/SmsSendAPI.java index 5c39a8a..cf1f5d0 100644 --- a/app/src/main/java/com/termux/api/SmsSendAPI.java +++ b/app/src/main/java/com/termux/api/SmsSendAPI.java @@ -7,6 +7,7 @@ import com.termux.api.util.ResultReturner; import com.termux.api.util.TermuxApiLogger; import java.io.PrintWriter; +import java.util.ArrayList; public class SmsSendAPI { @@ -26,8 +27,9 @@ public class SmsSendAPI { if (recipients == null || recipients.length == 0) { TermuxApiLogger.error("No recipient given"); } else { + final ArrayList messages = smsManager.divideMessage(inputString); for (String recipient : recipients) { - smsManager.sendTextMessage(recipient, null, inputString, null, null); + smsManager.sendMultipartTextMessage(recipient, null, messages, null, null); } } }