Re: [jetty-user] starting an android.app.Activity inside serverside code on i-jetty-2.2
Jan Bartel <[email protected]> Wed, 06 Apr 2011 08:27:12 +1000
| Newsgroups | gmane.comp.java.jetty.support |
|---|---|
| Organization | Webtide |
| Message-ID | <[email protected]> |
Hi,
If you look at the HelloWorld.java servlet class in the hello
webapp in the i-jetty srcs, you will see that webapps deployed
with i-jetty will have an android ContentResolver and an android
Context (that of i-jetty) pushed into the servlet context attributes.
Here's the snippet:
/* ------------------------------------------------------------ */
public void init(ServletConfig config) throws ServletException
{
super.init(config);
//to demonstrate it is possible
Object o = config.getServletContext().
getAttribute("org.mortbay.ijetty.contentResolver");
android.content.ContentResolver resolver =
(android.content.ContentResolver)o;
android.content.Context androidContext =
(android.content.Context)config.getServletContext().
getAttribute("org.mortbay.ijetty.context");
proofOfLife = androidContext.getApplicationInfo().packageName;
}
We make sure that the webapps' parent classloader is the android
loader that loaded i-jetty, so they have access to the android classes.
Hope that answers the questions,
Jan
On 06/04/11 01:33, Simon-Lennert Raesch wrote:
> Hi,
> I have a gwt project running on my i-jetty-2.2 installation and want to =
> start an android.app.Activity. I tried including the android.jar in the =
> build process of the .war but it can't processed by dex (without the =
> core-library feature, which I don't want to use).
>
> What is the preferred way of using the Android SDK from within a web =
> application? There is hardly any info on this on the web, I read one =
> email with a similar demand on one of the jetty mailing lists, but it =
> didn't get any replies. I hope this one does, as I really need to =
> achieve this behavior.
>
> Thanks in advance,
>
> Simon-Lennert Raesch
> [email protected] <mailto:[email protected]>
>
> University of Kassel
> Software Engineering
>
> Germany
--
Jan Bartel, Webtide LLC | [email protected] | http://www.webtide.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email