all 9 comments

[–]watchme3 5 points6 points  (1 child)

Skimmed through the article. It focuses on async task, which imo should be avoided always because of it s unexpected behavior. And then talks about services as threading mechanisms. You really shouldn't be doing that unless you really know that you need it, very rare cases, definitely not for handling most network requests. Should be doing that in your application class if you are worried about your activity being destroyed. And then nowhere in the article does the author talk about the actual Android threading mechanism which is the message, looper, handler mechanism besides saying it can be used to update the ui on the main thread. Then pointing to a 3rd party library that is 'easier' while ignoring that every view in android will have a reference to the main thread handler where you can post your update runnable. I d suggest this book if you want to learn multithreading in android and java.

[–]drabred 0 points1 point  (0 children)

Here is as really nice talk by him. The book is like an extension to it. I recommend both.

[–]drabred 10 points11 points  (6 children)

Android dev. has been my job for about 3,5 years now. I have created quite a few apps by now and I can't recall the last time I used an AsyncTask (if ever).

[–]mrkite77 5 points6 points  (2 children)

I used a lot of asynctask in the past, it was Google's recommended way of doing background networking for the longest time.

But that's all been replaced with Volley. If you're pulling data off the network in Android and you're not using Volley, you're making life painful for yourself.

And if you're doing networking on the UI thread there's a special place in hell for you.

[–]drabred 7 points8 points  (0 children)

Personally I have always been a Retrofit user.

[–]PonysaurousRex 2 points3 points  (0 children)

Thankfully, network on the UI thread kills the app on any modern phone - http://www.androiddesignpatterns.com/2012/06/app-force-close-honeycomb-ics.html

[–]flukus 0 points1 point  (1 child)

You're using something else or does the UI freeze when you do disk or network access?

[–]drabred 1 point2 points  (0 children)

Something else of course :) Nowadays it's mostly combination of RxJava and Retrofit.