I am new in Android, I have finished some Android app development courses and now I am trying to apply what I learned. I've chosen a news app for it. It will extract news' from 5-10 source and display them in recyclerview.
I recognized that the course materials I used is outdated. I've used AsynctaskLoader to handle internet connection issues but now in official Android documentation it says "Loaders have been deprecated as of Android P (API 28). The recommended option for dealing with loading data while handling the Activity and Fragment lifecycles is to use a combination of ViewModels and LiveData."
My question is should I convert my code to comply with ViewModels and LiveData or would Asynctask handle my task (or any other suggestion)? As I mentioned I only want to extract news data from a couple of source and display them in the app. It seems I don't need data storage feature. But, for now I have added two news source and the app seems to load news data a little bit late. Does this latency has something to do with using loaders? Would using viewmodels speed up news loading task (especially when there are lots of news source)?
If you've already written it with Loaders there's no reason to rush to change it. Deprecated doesn't mean gone. And no, Loaders don't add significant performance penalty- any perf issues would be elsewhere in your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With