Building a Custom Android ListAdapter

This is a snippet from the book “Kotlin and Android Development featuring Jetpack” by Michael Fazio, covering how to build a ListAdapter class for a native (Kotlin-based) Android app. A ListAdapter class is used along with a RecyclerView to display a list of items. The ListAdapter handles connecting the proper row data to a layout and sending all that information into the RecyclerView. Create a Custom List Adapter The PlayerSummaryAdapter class is responsible for managing all the PlayerSummary items in our list and handling how they’re displayed....

2021-03-28 · 5 min · Michael Fazio

Building an Android Repository

This is a snippet from my book “Kotlin and Android Development featuring Jetpack” from the Pragmatic Bookshelf, covering how to build a Repository class for a native (Kotlin-based) Android app. Here, we’re building an Android app based on a game called “Penny Drop”, which has each player rolling a single six-sided die and placing pennies in slots based on what they rolled. We’ve already created a Room-backed database, so now we need a way to access that database from various locations in the app....

2021-03-28 · 8 min · Michael Fazio