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. Why Gallery background complexity?

Just wondering why there is so much complexity involved in getting the
platform Gallery background.  The SDK provides a theme that contains
an attribute that is a drawable resource.   The theme is not a
drawable so it can't be used in a layout as a background.  The example
given is - 
http://developer.android.com/resources/tutorials/views/hello-gallery.html
- with these steps -

        TypedArray a =
obtainStyledAttributes(R.styleable.HelloGallery);
        mGalleryItemBackground = a.getResourceId(
 
R.styleable.HelloGallery_android_galleryItemBackground, 0);
        a.recycle();
        setBackgroundResource(mGalleryItemBackground);

where HelloGallery is a Them that includes the platform Theme
attribute that is the actual drawable  -

<resources>
    <declare-styleable name="HelloGallery">
        <attr name="android:galleryItemBackground" />
    </declare-styleable>
</resources>

All you really want is drawable/gallery_item_background.xml.
Unfortunately the very useful Gallery widget doesn't have default
focus behavior unless you do all this.

What is the benefit and/or rationale for all these layers?



-- 

2. [WTS] HTC Desire HD, HTC HD2 BNIB

Permisi, sebelum mudik, mau numpang jualan dulu..
Ready stock :
TC HD2 BNIB 2unit
TC Desire BNIB 20 unit

Semuanya Garansi resmi sistech singapore..

Bagi yg berminat, silahkan hubungi saya via japri mony...@gmail.com

Met natalan (bagi yg merayakan) 

€€€€.n ( o.. 
Sent from BlackBerry on 3

-- 
===============
"

3. Page Navigation Using button onclick in android

4. Apple's Solution. Was: Keystore

5. Camera zoom problem

6. [WTA] Bugs Galaxy S Froyo dan Ym Conference

7. Paging axis user.