Is it possible to receive Http requests on Android asynchronously?

Basically, I have a server and a mobile application . The mobile application subscribes to events from the server . The server than publishes events for all subscribers after some time (yup, good old publish / subscribe ).

The fact is that the server uses HTTP to send notifications . Therefore, I need in my application something like an HTTP server to process these requests asynchronously (i.e. without any special initial request).

Are there any means? I am thinking of creating a Socket and listening, but here there is the problem of converting HTTP from Socket data. I already read some questions around StackOverflow , but none of them point to the same problem directly. Or am I missing something? In any case, help is greatly appreciated and appreciated.

+3
source share
5 answers

C2D is good ... but it is still in beta and you should accept Google ToS. I would use it myself, using something like MQTT ... it's pretty easy to implement, fast, and you manage the data: http://tokudu.com/2010/how-to-implement-push-notifications-for-android/

+3
source
+2

...

AsyncTask .

( ), AsyncTask .

, - , . , , .

AsyncTask , , , .

0

You can use PUSH alerts or run a JETTY server on your Android device.

I have an application that works exactly the same, running the JETTY server on Android.

0
source

All Articles