Implementing the Activity
It’s time to implement the code for the UI, starting with the landing page, which is the main activity. We’ll first write the code to handle the airport code that the user enters into the text box and the button click. Then we’ll write the code to populate the RecyclerView with data obtained from the web service. That appears like a lot of work, but, surprisingly, we won’t need too much code to implement these actions. Let’s get started, one step at a time.
As the first step, let’s address head-on the need for coroutines in the UI. The UI will have to fetch the airport status from the web service, but we don’t want the UI to block and become inactive when the application is in the middle of network calls. To address ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access