There are few techniques to execute slow code that returns some data in Android. By slow code I mean network, file, database access etc.
Thread
andRunnable
can be used, but I found that getting produced data from aRunnable
is hard/not productive.We can use
Service
withBroadcast
, but I found that this is also not productive technique.We have nice
AsyncTask
class in Android.Is this last approach most productive way to execute slow background operations that return some data, or there is something better in Android?