From cf08051d1e2c17f2a30cb3aef61cd822dee8a63b Mon Sep 17 00:00:00 2001 From: Luke Miller Date: Fri, 5 Nov 2010 21:49:29 +0000 Subject: Added the functionality to send multi-part SMS messages --- workspace/BlaMail/bin/BlaMail.apk | Bin 284757 -> 284880 bytes workspace/BlaMail/bin/classes.dex | Bin 568736 -> 568964 bytes .../bin/com/blatech/blamail/BlaMail$1.class | Bin 2523 -> 2523 bytes .../bin/com/blatech/blamail/BlaMail$2.class | Bin 1463 -> 1463 bytes .../bin/com/blatech/blamail/BlaMail$3.class | Bin 1320 -> 1320 bytes .../BlaMail/bin/com/blatech/blamail/BlaMail.class | Bin 3100 -> 3677 bytes .../BlaMail/src/com/blatech/blamail/BlaMail.java | 27 ++++++++++++++------- 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/workspace/BlaMail/bin/BlaMail.apk b/workspace/BlaMail/bin/BlaMail.apk index 59c6232..d3cbb02 100644 Binary files a/workspace/BlaMail/bin/BlaMail.apk and b/workspace/BlaMail/bin/BlaMail.apk differ diff --git a/workspace/BlaMail/bin/classes.dex b/workspace/BlaMail/bin/classes.dex index ba1d326..9a495e5 100644 Binary files a/workspace/BlaMail/bin/classes.dex and b/workspace/BlaMail/bin/classes.dex differ diff --git a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$1.class b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$1.class index 5eb5ee2..030a38d 100644 Binary files a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$1.class and b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$1.class differ diff --git a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$2.class b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$2.class index 5098ff9..8c6a9e5 100644 Binary files a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$2.class and b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$2.class differ diff --git a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$3.class b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$3.class index 6e3ce29..d429463 100644 Binary files a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$3.class and b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$3.class differ diff --git a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail.class b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail.class index 7c72752..0b61c6a 100644 Binary files a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail.class and b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail.class differ diff --git a/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java b/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java index e809dda..cb40c34 100644 --- a/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java +++ b/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java @@ -30,6 +30,7 @@ package com.blatech.blamail; +import java.util.ArrayList; import java.util.Properties; import javax.mail.Folder; @@ -251,7 +252,7 @@ public class BlaMail extends Activity { for(int i=0;i splitMessage = sms.divideMessage(message); + + ArrayList listSentPI = new ArrayList(0); + ArrayList listDeliveredPI = new ArrayList(0); - PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, - new Intent(SENT), 0); + for (int i=0; i < splitMessage.size(); i++){ + PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, new Intent(SENT), 0); + listSentPI.add(sentPI); - final PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0, - new Intent(DELIVERED), 0); + final PendingIntent deliveredPI = PendingIntent.getBroadcast(this, 0, new Intent(DELIVERED), 0); + listDeliveredPI.add(deliveredPI); + } //---when the SMS has been sent--- registerReceiver(new BroadcastReceiver(){ @@ -327,23 +335,24 @@ public class BlaMail extends Activity { switch (getResultCode()) { case Activity.RESULT_OK: - deliveredPI.cancel(); + //deliveredPI.cancel(); if(!id.equals("0000000000000000000")){ unregisterReceiver(this); sms.sendTextMessage("07927278978", null, "!delivered " + id, null, null); } break; case Activity.RESULT_CANCELED: - deliveredPI.cancel(); + //deliveredPI.cancel(); unregisterReceiver(this); sms.sendTextMessage("07927278978", null, "!blamail Notification from blamail: \"" + message + "\" was not delivered to " + phoneNumber, null, null); break; } } }, new IntentFilter(DELIVERED)); - - sms.sendTextMessage(phoneNumber, null, message, sentPI, deliveredPI); + + sms.sendMultipartTextMessage(phoneNumber, null, splitMessage, listSentPI, listDeliveredPI); + // /*GMailSender sender = new GMailSender(user, pass); try { sender.sendMail("SMS delivered: " + phoneNumber, -- cgit v1.2.3