Hi,

Thanks for the input. It is part of research project (so we are using HTTP 
servers) and we also want to monitor battery in this scenario. As I am 
relatively new to developing these, please let me know if I am to use the 
code similar to Page 31, 32 of 
http://hc.apache.org/httpcomponents-core-ga/tutorial/pdf/httpcore-tutorial.pdf 
? 

Thank you!

On Wednesday, December 12, 2012 5:20:46 PM UTC+2, Kristopher Micinski wrote:
>
> This is nothing Android specific. 
>
> Designing HTTP servers that follow this pattern is a common Java 
> problem, but in my mind there is no reason that you should be doing 
> this on Android.  Instead you should be communicating with your 
> service using messages to and from a service using a smart mechanism 
> (GCM) to talk back to your apps. 
>
> HTTP servers will kill the battery... 
>
> But if you insist that your app is special, the common pattern is to 
> have a dedicated thread that handles the connection and forks off 
> worker threads to handle incoming requests, this is the common case. 
>
> Is there any reason you'd want truly non blocking I/O?  But the answer 
> is Java nio, which Android *does* include: 
>
> http://developer.android.com/reference/java/nio/package-summary.html 
>
>
> http://blog.codepainters.com/2012/02/17/why-java-nio-is-a-better-idea-for-android/
>  
>
> Kris 
>
> On Wed, Dec 12, 2012 at 8:27 AM, Archana 
> <ramalinga...@gmail.com<javascript:>> 
> wrote: 
> > Hi, 
> > 
> > I used  request.getRequestLine().getMethod(); that tells me if the 
> method is 
> > GET/DELETE/POST and handle it accordingly. Any idea of how can I make my 
> > HTTP server in the Android phone non-blocking? I mean to simultaneously 
> > handle POST, GET and DELETE requests ? 
> > 
> > Thank you! 
> > 
> > 
> > On Tuesday, December 4, 2012 12:58:42 PM UTC+2, skink wrote: 
> >> 
> >> 
> >> 
> >> Archana wrote: 
> >> > Hi, 
> >> > 
> >> >  is it using HttpService.handleRequest? Please help as I dont have 
> much 
> >> > idea of using HTTP Core. 
> >> > 
> >> > 
> >> 
> >> i have not used HttpService so cant help much 
> >> 
> >> pskink 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Android Developers" group. 
> > To post to this group, send email to 
> > android-d...@googlegroups.com<javascript:> 
> > To unsubscribe from this group, send email to 
> > android-developers+unsubscr...@googlegroups.com <javascript:> 
> > For more options, visit this group at 
> > http://groups.google.com/group/android-developers?hl=en 
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to