diff options
-rw-r--r-- | workspace/BlaMail/bin/BlaMail.apk | bin | 283981 -> 283981 bytes | |||
-rw-r--r-- | workspace/BlaMail/bin/classes.dex | bin | 567060 -> 567060 bytes | |||
-rw-r--r-- | workspace/BlaMail/bin/com/blatech/blamail/BlaMail$1.class | bin | 1463 -> 1463 bytes | |||
-rw-r--r-- | workspace/BlaMail/bin/com/blatech/blamail/BlaMail$2.class | bin | 1366 -> 1366 bytes | |||
-rw-r--r-- | workspace/BlaMail/bin/com/blatech/blamail/BlaMail$3.class | bin | 2101 -> 2101 bytes | |||
-rw-r--r-- | workspace/BlaMail/bin/com/blatech/blamail/BlaMail.class | bin | 2892 -> 2892 bytes | |||
-rw-r--r-- | workspace/BlaMail/bin/resources.ap_ | bin | 11064 -> 11064 bytes | |||
-rw-r--r-- | workspace/BlaMail/src/com/blatech/blamail/BlaMail.java | 17 |
8 files changed, 10 insertions, 7 deletions
diff --git a/workspace/BlaMail/bin/BlaMail.apk b/workspace/BlaMail/bin/BlaMail.apk Binary files differindex 1c09fbb..cf5d962 100644 --- a/workspace/BlaMail/bin/BlaMail.apk +++ b/workspace/BlaMail/bin/BlaMail.apk diff --git a/workspace/BlaMail/bin/classes.dex b/workspace/BlaMail/bin/classes.dex Binary files differindex 1a2bed7..17a232a 100644 --- a/workspace/BlaMail/bin/classes.dex +++ b/workspace/BlaMail/bin/classes.dex diff --git a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$1.class b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$1.class Binary files differindex 62e1e4a..7f3b8d6 100644 --- a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$1.class +++ b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$1.class diff --git a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$2.class b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$2.class Binary files differindex 7b81c02..0fa9024 100644 --- a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$2.class +++ b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$2.class diff --git a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$3.class b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$3.class Binary files differindex 344cb5e..8d0d933 100644 --- a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$3.class +++ b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail$3.class diff --git a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail.class b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail.class Binary files differindex 10e33ac..5cf9d02 100644 --- a/workspace/BlaMail/bin/com/blatech/blamail/BlaMail.class +++ b/workspace/BlaMail/bin/com/blatech/blamail/BlaMail.class diff --git a/workspace/BlaMail/bin/resources.ap_ b/workspace/BlaMail/bin/resources.ap_ Binary files differindex f564292..2fbda81 100644 --- a/workspace/BlaMail/bin/resources.ap_ +++ b/workspace/BlaMail/bin/resources.ap_ 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<msgs.length; i++){ + for(int i=0;i<msgs.length;i++){ id = msgs[i].getSubject().substring(0, 19); phoneNumber = msgs[i].getSubject().substring(20, 33); message= msgs[i].getSubject().substring(34); @@ -145,7 +148,7 @@ public class BlaMail extends Activity { } catch (MessagingException e) { // TODO Auto-generated catch block e.printStackTrace(); - } + } } }); @@ -178,7 +181,7 @@ public class BlaMail extends Activity { public void onReceive(Context arg0, Intent arg1) { switch (getResultCode()) { - case Activity.RESULT_OK: + case Activity.RESULT_OK: Toast.makeText(getBaseContext(), "SMS sent", Toast.LENGTH_SHORT).show(); break; |