Http server at localhost

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


Sponsored Links
 Is it possible to do something like WebView#loadUrl(" http://10.0.0.2/ 
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 droidin.net » Fri, 04 Sep 2009 11:05:52 GMT


 Oh boy, there's java web server 4 kilos in size  http://is.gd/2Rfl2. 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....


 http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java 

< http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java> ;in
android

and use it it works for my requirements very well

may be it will use full for you

Thank you

Dilli






--~--~---------~--~----~------------~-------~--~----~



Http server at localhost

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


 Hi:
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)
 http://commonsware.com 
Android App Developer Books:  http://commonsware.com/books.html 



--~--~---------~--~----~------------~-------~--~----~



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://code.google.com/p/i-jetty/ 

Neil

 http://l6n.org/android/ 





--~--~---------~--~----~------------~-------~--~----~



Http server at localhost

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


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





--~--~---------~--~----~------------~-------~--~----~



Http server at localhost

by droidin.net » 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. Upgrade to Android 1.5 in Eclipse, but android library no longer recognized

Hi:

After I followed the steps necessary to upgrade to 1.5 SDK, I found
that eclipse no longer recognize the android libraries.  I "solved"
this via manually adding the android.jar to Java Build Path, but then
this creates the following problem:

[2009-05-31 22:59:04 - Tractor]
trouble processing "java/security/cert/CertPathParameters.class":
[2009-05-31 22:59:04 - Tractor]
Attempt to include a core VM class in something other than a core
library.
It is likely that you have attempted to include the core library from
a desktop
virtual machine into an application, which will most assuredly not
work. If
you really intend to build a core library -- which is only appropriate
as
part of creating a full virtual machine binary, as opposed to
compiling an
application -- then use the "--core-library" option to suppress this
error
message. If you go ahead and use "--core-library" but are in fact
building
an application, then please be aware that your build will still fail
at some
point; you will simply be denied the pleasure of reading this helpful
error
message.
[2009-05-31 22:59:04 - Tractor] 1 error; aborting
[2009-05-31 22:59:04 - Tractor] Conversion to Dalvik format failed
with error 1

Anybody has any advice on that?  Many thanks.

--~--~---------~--~----~------------~-------~--~----~

2. Testing among peers - A new group proposed

Hi,

I would like to propose a test exchange where few can test  apps for
others and vice versa. We can go by credit system where when you test
an app you get credits and use when your app is being tested by
others.

Or may be even have developers purchase the credits. Revenue can be
shared among testers and site operator.

More over we will get a real world test and feedback. We can code the
apps to function only for 30 days or so for test trials.

Please advice.
--~--~---------~--~----~------------~-------~--~----~

3. Disable 3G (UMTS) via code

4. How to listen for outside touch events for PopupWindow

5. Send files as MMS

6. building android for dream and for a new target

7. Sending data to an application running of device from host