Though it's worth noting that since an `IntentService` doesn't run in
a background thread context.  (Probably one of the biggest things
beginners screw up..)

Kris

On Wed, Mar 20, 2013 at 9:49 AM, Streets Of Boston
<flyingdutc...@gmail.com> wrote:
> There are even more ways of doing stuff in the background: IntentService :-)
>
> Runnable
> If you mean a Thread (running itself or a Runnable): Generally, avoid using
> them. But there are good use cases: When you want to setup something that
> runs in the background for a long time (possible during the entire lifetime
> of your app's process), simple Threads are very useful, e.g. set up a
> rendering thread for an openGL game.
> AsyncTasks
> If you want to run something in the background, that is a one-shot
> operation, relatively short duration and you want your UI (main UI-thread)
> to be notified about updates/results. If you are not worried about screen
> rotations/config-changes, etc., AsyncTasks work well. AsyncTasks in these
> situations are relatively simple to implement.
> Loaders, AsyncTaskLoaders
> Like AsyncTasks, but they are well suited to easily handle screen
> rotations/config-changes/etc, especially when used in conjunction with
> Fragments.
> IntentService
> Also good for one-shot operations with relatively short duration. Best used
> when you want to share these operations among other components of your or
> other people's applications and/or want to have Android manage its
> life-cycle (e.g. if an (Intent)Service is killed, Android could restart it
> for you automatically and re-issue the Intent that started it before).
>
>
> On Tuesday, March 19, 2013 8:33:50 PM UTC-4, littledot wrote:
>>
>> Android concurrency has always bugged me...
>>
>> These are all methods to achieve essentially the same thing:
>> mutli-threading
>>
>> I honestly don't see much difference between them, except the amount of
>> code you need to write......
>>
>>
>>
>> Which methods do you use?
>>
>> Are there certain situations where you prefer one method over the other?
>>
>> Or do you stick to one method and use it as a rule-of-thumb?
>>
>>
>>
>> Thanks for reading.
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to