Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Is the android version of asynctask deprecated?


Asked by Phillip Acosta on Nov 29, 2021 Android



For the past decade AysncTask has been a very popular approach for writing concurrent code in Android applications. However, the era of AsyncTask ended because, starting with Android 11, AsyncTask is deprecated.
Keeping this in consideration,
For the past years, AsyncTask has already been “effectively deprecated” by Android developers themselves. Many of us openly advocated against using this API in applications and I, personally, feel sorry for developers who maintain codebases that use AsyncTask extensively.
One may also ask, There were days when async task in Android was really very great. They allowed us to perform operations in a non thread blocking manner. They were great and not so great at the same time ( stares Schrödinger (ly) ). But now as of Android 11 ( API 30 ) they have been deprecated.
Consequently,
All in all, Android community has mix opinions about AsyncTask. But there is a big news from google, AsyncTask is deprecated in Android API level 30. The end of AsyncTask era ! Now all android developers must do this extra work of changing all AsyncTask with some other background operation tool.
Moreover,
Android AsyncTask going to do background operation on background thread and update on main thread. In android we cant directly touch background thread to main thread in android development. asynctask help us to make communication between background thread to main thread.