Posts

Featured Post

Android AsyncTask API deprecating in Android 11. Here is another way? in JAVA (java.util.concurrent)

Image
Android AsyncTask API deprecating in Android 11. Here is another way? in JAVA Google is deprecating Android AsyncTask API in Android 11 and suggesting to use java.util.concurrent instead. If you’re maintaining an older codebase with asynchronous tasks in Android, you’re likely going to have to change it in future. Concurrency is widely regarded as one of the most difficult challenges among all fields of computation. If you are still wondering how it works under the hood then I suggest that as a learning goal, but we will not be going that low level today. Instead we will look at a practical way to write concurrent code which gives us more control than AsyncTask, but requires orders of magnitude less configuration (barely any at all) than a very expansive library like RxJava. It also requires no 3rd party libraries Alternative of AsyncTask The officially recommended alternative is Kotlin Coroutines, that you must use of writing Asynchronous Code in your project. But if you are ...