File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes imap to fetch gmail in android fail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "imap to fetch gmail in android fail" Watch "imap to fetch gmail in android fail" New topic
Author

imap to fetch gmail in android fail

Niklas Karlsson
Greenhorn

Joined: Apr 06, 2014
Posts: 3


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
Marshal

Joined: Mar 22, 2005
Posts: 42374
    
  64
The standard JavaMail library doesn't work on Android. You need to use a port - found somewhere on Google Code- instead.


Ping & DNS - my free Android networking tools app
Niklas Karlsson
Greenhorn

Joined: Apr 06, 2014
Posts: 3
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
Marshal

Joined: Mar 22, 2005
Posts: 42374
    
  64
This is it: http://code.google.com/p/javamail-android/
Niklas Karlsson
Greenhorn

Joined: Apr 06, 2014
Posts: 3
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
Marshal

Joined: Mar 22, 2005
Posts: 42374
    
  64
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: imap to fetch gmail in android fail