I'm trying to develop an e-mail client for android using JavaMail and JavaMaildir. I've downloaded JavaMaildir from here: http://sourceforge.net/projects/javamaildir/, version 0.5
.
I've added the .jar
file into the libs
folder of my android project. The project compiles without problem.
Here is the code I'm using to initialize the store object:
Properties prop = new Properties();
prop.put("mail.store.maildir.autocreatedir", true);
this.session = Session.getInstance(prop);
// Creates the directory if it doesn't exists
File dir = this.getDir(POP3ClientService.md_name, Context.MODE_PRIVATE);
String url = "maildir:" + dir.getAbsolutePath();
Log.d("DEBUG", url);
try {
this.store = this.session.getStore(new URLName(url));
} catch (NoSuchProviderException e) {
// TODO Auto-generated catch block
this.store = null;
Log.e("ERROR", e.getMessage());
}
http://javamaildir.sourceforge.net/examples/ Which is taken from the example available on the project site: http://javamaildir.sourceforge.net/examples/
Unfortunately, it throws a NoSuchProviderException
and therefore I cannot use the store since it's a null pointer.
The error message says No provider for maildir
. Where am I wrong?