Http server at localhost

by » Fri, 04 Sep 2009 07:50:42 GMT

Sponsored Links
 Is it possible to do something like WebView#loadUrl(" 
index.html") with service acting as local http server? Where would one
start? Will I need at least partial http server implementation that
would listen on the socket?

Http server at localhost

by Chris Stratton » Fri, 04 Sep 2009 09:25:38 GMT

 Yes and you have the right idea about needing something that will
listen on a socket, but you will probably need to put it on a higher
port number and include that in the URL, since on most linuxes non
privileged processes cannot claim low port numbers such as 80.   Port
8080 was often used in the old days...

You could do this by porting some compact embedded linux http server
by abusing the ndk toolchain, but the android folks would say it's
better done in java


Sponsored Links

Http server at localhost

by » Fri, 04 Sep 2009 11:05:52 GMT

 Oh boy, there's java web server 4 kilos in size I 
wonder though what would be faster - doing WebView#loadUrl from such
server or WebView#loadDataWithBaseUrl from value stored in the
preferences. In any event - first one will be cached by browser, with
history provided which is not a small gain, plus - I can store files
for that webserver on the card.
I will try this tonight,

Thanks Chris!


Http server at localhost

by dilli rao » Fri, 04 Sep 2009 11:28:44 GMT

 you can set a http server running in the local machine (Android)and you can
uset it as a simple server

try to port the server in android (as it is ) no modifications required.... 

<> ;in

and use it it works for my requirements very well

may be it will use full for you

Thank you



Http server at localhost

by Thomas (geomancer) » Fri, 04 Sep 2009 18:58:58 GMT

Like Duh on  my part, but what would a local server listen for?
Tom B


Http server at localhost

by Haravikk » Fri, 04 Sep 2009 21:12:19 GMT

 Does Android include support for Servlets? As you could possibly just
use an HTTP servlet to serve-up pages, using JSP as well if that's
supported, both are pretty neat ways to do that. Unless you're hoping
to use PHP or something for fancy pages, but I'd steer well clear of
that personally, and go for the all java solution (JSP served using an
HTTP servlet).


Http server at localhost

by Mark Murphy » Fri, 04 Sep 2009 21:21:54 GMT

 > Does Android include support for Servlets?

Android does not have a built-in HTTP server, let alone a servlet engine.

Mark Murphy (a Commons Guy) 
Android App Developer Books: 


Http server at localhost

by Neil » Fri, 04 Sep 2009 21:49:54 GMT

 I think jetty is the thing you're looking for: 



Http server at localhost

by » Fri, 04 Sep 2009 23:35:22 GMT

 WebView#loadUrl(" :8080/index.html")


Http server at localhost

by » Fri, 04 Sep 2009 23:41:09 GMT

 Oh my God! Access your phone from the browser - I'm going to be
sick... Beyond brilliant!


Other Threads

1. Internal vs external storage speed


What's the word on this subject? I have a gridview with a lot of
thumbnails, I look first for them in main memory and if not present
then on the SD card. I thought there could be a small speed
improvement doing the L2 caching on the internal memory but certainly
can't feel any difference.

I'm asking because I would like to get rid as much as possible of the
little slowdown when the grid view starts to ask for images cached in
the sd and not in main memory.



2. images not scaled to screen size

Hai All,

I did go through the Multiple screen support document:

I'm using freescale imx51 board connected to a DELL 17" TFT monitor.
The default applications do appear full screen. But when I port my
custom application it renders in compatibility mode. I have observed
that the images that are in the folder "mdpi" are being used by the
application for the above said display.. I have also tried using
support screen and any density parameters in the manifest file.

I have all the three folders (hdpi, ldpi, mdpi) holding density
specific images. First I tested my application on the emulator (Medium
Density / Normal Screen). Hence my image size were specific to 480X320
mode). I generated hdpi and ldpi images accordingly:
hdpi = 1.5 x mdpi
ldpi = 0.75 x mdpi

Please help understand why the custom application not being rendered
full screen like all other default pplication. Why are images not
being scaled to fit the DELL 17" monitor connected to the imx51

Also what exactly should be values of support screen and any-density
fields in the manifest file when above said display's are being used

Thanks in advance



3. how to get the SoftInputView is shown with another process?

4. Koran Kompas di android

5. 1 month to go and nothing was stirring....

6. Submitting patches to API documentation

7. How to teach a bunch of newbie kids.