The UI Thread and the class AsyncTask in Android | 7/12 | UPV

Published: 26 December 2013
on channel: Universitat Politècnica de València - UPV
2,837
12

Título: The UI Thread and the class AsyncTask in Android


Descripción automática: In this video, the Professorial of Computer Science at a German university introduces the concept of the user interface thread in Android and how the AsyncTask class is used for programming background threads. He explains the necessity of using background threads to prevent the UI from freezing by handling long events outside the main thread. The process includes the main thread starting a background thread, transferring parameters, and processing concurrently while updating the main thread on progress.

The speaker further addresses the issue that in Android, threads other than the UI thread cannot directly access the graphical user interface due to thread safety concerns. This is where the AsyncTask helper class becomes useful as it allows for operations to be performed concurrently with the UI thread, managing the transfer of parameters, progress updates, and result returns between threads.

The AsyncTask class is further examined, outlining its abstract nature and the need to subclass it to use it effectively. Three generic types are described for operation parameters, progress information, and operational results. Important methods of AsyncTask such as execute(), doInBackground(), publishProgress(), and onPostExecute() are discussed in the context of their role in the cooperation between the UI and background threads. The video concludes by emphasizing that AsyncTask simplifies the complexity of programming background threads in Android by providing structured methods for seamless communication between UI and background threads.

Autor/a: Vogt Carsten

Curso: Este vídeo es el 7/12 del curso Curso Android Avanzado | Universitat Politècnica de València (UPV).    • Curso Android Avanzado  | Universitat...  


Universitat Politècnica de València UPV: https://www.upv.es
Más vídeos en:    / valenciaupv  
Accede a nuestros MOOC: https://upvx.es

#android #moviles #programacion #programación #dispositivos #móviles


Watch video The UI Thread and the class AsyncTask in Android | 7/12 | UPV online without registration, duration hours minute second in high quality. This video was added by user Universitat Politècnica de València - UPV 26 December 2013, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,837 once and liked it 12 people.