Chapter 19. And Yet, We Persisted

If we take stock of where we are with our app so far, it’s come along quite nicely. We’ve got some solid functionality. The data being pulled is backed by a portable format, specifically JSON, and it’s functionally sound. This is a great starting place to take our app further.

Detailing Our Books

First, we should add a new screen to show some more information on a book. Right now, there really isn’t a way to view anything of importance about our books other than the title. And guess what? Books have a TON of information about them. Everything from title, author, ISBN, the list goes on! In fact, some of the most usable information about a book is contained in this information.

We know we’ll display a book. Specifically, the information currently available in our book model object, Book, is the following:

  • title

  • authors

  • isbn

  • pageCount

  • fiction

That’s not tons of data, but it’s enough. Plus, we’re going to expand on this screen in a bit, but for now let’s add something quickly in Android and iOS.

Android

If you recall Chapter 2 and Chapter 15, what follows should be very familiar.

First, let’s define our layout using XML. We know we want to show each of the Book instances properties, so let’s just list them out in a vertical fashion that we’ll decorate programmatically. Again, we’ll want to make sure our LinearLayout is wrapped in a ScrollView so that we can show all our information regardless of screen size, device density, or accessibility ...

Get Native Mobile Development 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.