Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

imap to fetch gmail in android fail

 
Niklas Karlsson
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi all, I am trying to make a android-app that do following:
-GUI call "imap"-function that connect to a "gmail-account" (with username and password).
and if a mail have a specific subject and after a specific date, then start UI-alarm, that start a "sound alarm" example with soundpool..

I have added this in manifest:


I have this code that work in java, but not in android:



_____________________________________

I have fount this "android-code" and can not get it to work:-(






the logcat tell me:


___________________________________________

I have added lib:
mail.jar
activation.jar
additional.jar

can some one guide me in the right direction?

Best regards
Niklas
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard JavaMail library doesn't work on Android. You need to use a port - found somewhere on Google Code- instead.
 
Niklas Karlsson
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you!

"Darn", i have only find k9, that i dont undersand :-(, is there any others like javamailapi?
Or does any one have a example?
Can't find a "android-IMAP-gmail" code for this

Best regards
Niklas
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is it: http://code.google.com/p/javamail-android/
 
Niklas Karlsson
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great!:-)
yes but I fail to use this (mail.jar, etc, in the main-question )

The example is for "smtp"(send) and not fetch(imap), i hope I can manage to solve this anyway.
If any one have a link with sampel-imap-code, please feel free post

Best regards

Niklas
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frankly, I haven't used it myself, but the project home page says that it supports IMAP, so...

In the apps I worked on, I don't send emails automatically, but trigger an Intent with all the data to the email app, so that the user can alter it to his heart's content before clicking Send.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic