0

I am using ijetty and I have a war deployed on it. One service it provides it to send emails out from the phone remotely. The recipients/subject/body are all POSTed to the server and I want to send them out of the phone.

I am using this method and it send the mail fine but I need the users credentials. Even if I could just get the email and then the user posted the password that would be fine but to do this I need to use

AccountManager accountManager = AccountManager.get(context); 

The problem is that I do not know how to get ijetty's context so that I can get the accounts.

If anyone can help or provide some other direction I would greatly appreciate it.

Community
  • 1
  • 1
user758105
  • 77
  • 1
  • 7

1 Answers1

0

Ok so I got an awnser from the ijetty mailing list and here it is,

android.content.ContentResolver resolver =
(android.content.ContentResolver)getServletContext().getAttribute("org.mortbay.ijetty.contentResolver");
android.content.Context androidContext =
(android.content.Context)getServletContext().getAttribute("org.mortbay.ijetty.context");

With these 2 objects you should be able to do what you want. Alternatively, you could always subclass i-jetty to provide access to more android objects.

user758105
  • 77
  • 1
  • 7