Load Data from External APIs
Web service calls may be the task most improved by moving to Kotlin + Jetpack (plus Retrofit, which we just covered). You used to have to build a new child class of AsyncTask, override the functions there, hope you didn’t accidentally leak the context somewhere, and then finally update the UI once the processing was done.
Now? We’ve got coroutines, LiveData, and suspend functions to make everything smoother and clearer. Also, the type-safe suspend functions from Retrofit make calling APIs so much smoother.
Load Standings Data via the ABL API Client
Inside AndroidManifest.xml, we need to give the app permission to access the internet and check the current network state of the device. We do this by adding one <uses-permission> ...
Get Kotlin and Android Development featuring Jetpack now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.