Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It is not a good idea to use AsyncTasks for file downloads (as the name of your AsyncTask suggests). AsyncTasks should not be used for long running operations such as networking. Indeed AsyncTask have two main issues that are related : </p> <ul> <li>they are poorly tied to the activity life cycle</li> <li>the create memory leaks very easily.</li> </ul> <p>Inside the <a href="https://github.com/octo-online/robospice" rel="nofollow">RoboSpice</a> Motivations app (<a href="https://play.google.com/store/apps/details?id=com.octo.android.robospice.motivations" rel="nofollow">available on Google Play</a>) we answer that question in detail. It will give an in-depth view of AsyncTasks, Loaders, their features and drawbacks and also introduce you to an alternative solution for network requests : RoboSpice.</p> <p>We even provided <a href="https://github.com/octo-online/robospice/wiki/Understand-the-basics-of-RoboSpice-in-30-seconds" rel="nofollow">an infographics</a> to explain this issue. To put it in a few words </p> <ul> <li>AsyncTasks are flawed as they are poorly tied to Activity Lifecycle and create memory leaks</li> <li>Loaders are pretty good for what they have been designed for : accessing cursors of Sqlite databases, but don't offer any support for networking. They are the wrong tool for this.</li> <li>RoboSpice executes network requests in a service, your downloads are executed in an Android Service, memory is well managed and it even provides support for writing REST requests.</li> </ul> <hr> <p>I encourage you to download the <a href="https://play.google.com/store/apps/details?id=com.octo.android.robospice.motivations" rel="nofollow">RoboSpice Motivations app</a>, it really explains this in-depth and provides samples and demonstrations of the different ways to do some background operations.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload