AsyncTask:
AsyncTask is an abstract class provided by Android which helps us to use the UI thread properly. This class allows us to perform long/background operations and show its result on the UI thread without having to manipulate threads.
advantages of using AsyncTasks:
- Easy to learn and implement.
- It is having good process control.
Disadvantages of using AsyncTasks:
- No orientation-change support.
- No ability to cancel network calls.
- As well as no easy way to make API calls in parallel.
- With the exception of Froyo and Gingerbread, Async Tasks (by default) run in a serialised fashion.
- In a practical sense, this means that only one AsyncTask is running at any given time.
- Views that require multiple API calls (the DashBoard currently has 7) run extremely slow, sometimes taking multiple seconds to load.
No comments:
Post a Comment