Maybe you should try to use threads first and see what happens... :-).... It's funny you mention that you don't want to use this approach because it has "overhead, performance and scalability" issues: running a server on Android has those issues!
If you are really concerned about performance and scalability, you should be using GCM, not writing your own server: servers were never meant to run on Android anyway. And you won't be able to scale it: any carrier will probably block ports anyway. Kris On Tue, Dec 18, 2012 at 8:40 AM, Archana <[email protected]> wrote: > I read using threads causes overhead, performance and scalability issues. It > is efficient if there are a limited number of clients. So I think using > java.nio would be the best option. Any example that shows handling the HTTP > methods without blocking. > > On Monday, December 17, 2012 7:06:00 PM UTC+2, Kristopher Micinski wrote: >> >> On Mon, Dec 17, 2012 at 6:35 AM, Archana <[email protected]> wrote: >> > Hi, >> > >> > Is it like having separate thread for each request(GET/POST/DELETE) ? >> > Can >> > you please explain? I was also thinking of AsyncTask, message queue or >> > multithreading. >> > >> > Thanks! >> >> Basically, those are all equivalent... >> >> AsyncTask is using a thread pool under the hood, a message queue will >> probably be a key step in using multi threading also. >> >> One nice thing about these requests is that handling them typically >> doesn't involve much cross communication between requests: as long as >> you can serialize on transactions through "shared" pieces of the app. >> E.g., if you have a GET request which grabs some information from a >> database, you can spawn a thread to get the info from the different >> tables and amalgamate it. If you subsequently get a DELETE you can >> delete all the required information. One key thing here will be to >> think about transactions if you have more complex SQL statements. >> (Single queries are implicitly wrapped in transactions anyway, by >> sqlite, iirc...) >> >> There is nothing specific to Android here though, >> >> kris > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

