3 ms·
When I started development on Android platform I was told that we should not do IO on UI thread. Fine enough. What is the alternative? Every tutorial out there
by tn13 10y ago
When I started development on Android platform I was told that we should not do IO on UI thread. Fine enough. What is the alternative? Every tutorial out there including Google's suggested AsyncTask.
Only after few weeks I learned that we should never use AsyncTask for IO because internally it uses a threadpool of hold your breath 2 threads !
So how do I make all my REST requests ? Through something like Volley.
This library is even more disgusting as it does not support some simple urls such as http://example.org/?id=1&id=2 http://example.org/?id=1&id=2.
So I turned by focus on Services only to learn later that Services are meant for background tasks but run on UI thread.
The best approach to do your own IO is through IntentServices. Something that should have appeared in the first tutorial.