From df528933657f73d546ad6cc431f9537f985f720f Mon Sep 17 00:00:00 2001 From: Luke Miller Date: Sun, 31 Oct 2010 00:20:19 +0100 Subject: Added message loop to ensure simultaneous messages are sent --- workspace/BlaMail/bin/BlaMail.apk | Bin 283981 -> 283981 bytes workspace/BlaMail/bin/classes.dex | Bin 567060 -> 567060 bytes .../bin/com/blatech/blamail/BlaMail$1.class | Bin 1463 -> 1463 bytes .../bin/com/blatech/blamail/BlaMail$2.class | Bin 1366 -> 1366 bytes .../bin/com/blatech/blamail/BlaMail$3.class | Bin 2101 -> 2101 bytes .../BlaMail/bin/com/blatech/blamail/BlaMail.class | Bin 2892 -> 2892 bytes workspace/BlaMail/bin/resources.ap_ | Bin 11064 -> 11064 bytes .../BlaMail/src/com/blatech/blamail/BlaMail.java | 17 ++++++++++------- 8 files changed, 10 insertions(+), 7 deletions(-) (limited to 'workspace/BlaMail') diff --git a/workspace/BlaMail/bin/BlaMail.apk b/workspace/BlaMail/bin/BlaMail.apk index 1c09fbb..cf5d962 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 1a2bed7..17a232a 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 62e1e4a..7f3b8d6 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 7b81c02..0fa9024 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 344cb5e..8d0d933 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 10e33ac..5cf9d02 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/bin/resources.ap_ b/workspace/BlaMail/bin/resources.ap_ index f564292..2fbda81 100644 Binary files a/workspace/BlaMail/bin/resources.ap_ and b/workspace/BlaMail/bin/resources.ap_ differ diff --git a/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java b/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java index dede9fc..d693355 100644 --- a/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java +++ b/workspace/BlaMail/src/com/blatech/blamail/BlaMail.java @@ -32,6 +32,7 @@ package com.blatech.blamail; import java.util.Properties; +import javax.mail.Flags; import javax.mail.Folder; import javax.mail.Message; import javax.mail.MessagingException; @@ -98,7 +99,8 @@ public class BlaMail extends Activity { String message; public void run() { - /** monitor e-mail */ + /** check for e-mail */ + try { Properties props = new Properties(); @@ -121,22 +123,23 @@ public class BlaMail extends Activity { store.connect(host, user, pass); - //Get all mails in Inbox Forlder - Folder folder = store.getFolder(mbox); + //Get all mails in Inbox Folder + Folder folder = store.getFolder(mbox); if (folder == null || !folder.exists()) { //System.out.println("Invalid folder"); Toast.makeText(getBaseContext(), "Invalid Folder", Toast.LENGTH_SHORT).show(); System.exit(1); } + folder.open(Folder.READ_ONLY); - + // Add messageCountListener to listen for new messages folder.addMessageCountListener(new MessageCountAdapter() { public void messagesAdded(MessageCountEvent ev) { Message[] msgs = ev.getMessages(); try { - for(int i=0; i