I was wondering if there is any way to create asynchronous callback functions in an android client similar to AJAX, binding an event handler to a ‘response received’ event. I am looking for something like this:
- Client sends data through POST or GET to the server and the app is not locked, waiting for response.
- Server process the data and sends a response.
- The app receives the response and at this time an event is raised and its event handler is executed.
AsyncTask is all you need. http://developer.android.com/reference/android/os/AsyncTask.html