Question: Android provides several techniques, such as Handler and AsyncTask, for enabling the multithreading in an application. Based on your understanding of multithreading in Android, answer
Android provides several techniques, such as Handler and AsyncTask, for enabling the multithreading in an application. Based on your understanding of multithreading in Android, answer the following questions:
a) Can an AsyncTask be executed in a worker thread? Explain your answer.
b) Suppose that an application needs to execute a long running task. The application also needs to report about the progress of the task to the user as well. Which technique among Service, Handler, and AsyncTask will you prefer to accomplish the above mentioned features of the task? Give an example and based on that example, explain that your preferred technique is the most suitable technique among all alternatives.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
