Earlier I was using Default Http client of android and then found this library at http://loopj.com/android-async-http/
When I use this library inside doInBackground(String... args) of AsyncTask, I noticed that postExecute() finished before android-async-http returned.
Should I not use AsyncTask if I'm using AsyncHttpClient. If I only use AsyncHttpClient, is there way to handle timeouts on slow internet connection or internet access.
I'm new to android, please help!
As implied by the above library you can make network calls asynchronously i.e. not on the main thread and that is why we actualy use asynctask to avoid blocking the main thread.
So , if you are using the above library then there is no need to use Asynctask
and I am sure you will never get NetworkConnectionOnMainThreadException
. Hope this helps.