Chapter 10 Load and Save Data with Coroutines and Room

Kotlin and Android Development featuring Jetpack — by Michael Fazio (77 / 125)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Summary and Next Steps | TOC | Create a Database 👉

Everything we’ve done in this book so far has been focused on working within an app, but now it’s time to reach out and bring in some external data. We’re going to be calling out to the Android Baseball League APIs to get up-to-date scores, standings, and statistics.

In particular, we’ll pull in data for the current games and standings in the league. We did the initial work on the latter screen in Add Fragments (Standings and Single Team), but that was with mocked-up data. The Scoreboard page is new (and frankly, complicated), so you’ll again pull in the code rather than us going through all of it.

Having current data is going to be great, but we could really use some place to hang onto it. That means we need a Room database to store all our data, so let’s get that created first.

👈 Summary and Next Steps | TOC | Create a Database 👉

Kotlin and Android Development featuring Jetpack by Michael Fazio can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.