Chapters

Hide chapters

Android Apprentice

Third Edition · Android 10 · Kotlin 1.3 · Android Studio 3.6

Before You Begin

Section 0: 4 chapters
Show chapters Hide chapters

Section II: Building a List App

Section 2: 7 chapters
Show chapters Hide chapters

Section III: Creating Map-Based Apps

Section 3: 7 chapters
Show chapters Hide chapters

19. Finishing Touches
Written by Tom Blankenship

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

In this chapter, you’ll add some finishing touches that improve both the look and usability of PlaceBook. Even though PlaceBook is perfectly functional as-is, it’s often the subtle enhancements that make an app go from good to great. With that in mind, you’ll wrap things up by making the following changes:

  • Adding categories for bookmarks.
  • Displaying category specific icons on the map.
  • Adding place search.
  • Adding ad-hoc bookmark creation.
  • Adding bookmark deletions.
  • Adding bookmark sharing.
  • Updating the color scheme.
  • Displaying progress using indicators.

Getting started

The starter project for this chapter includes additional resources and an updated app icon. You can either begin this chapter with the starter project or copy the following resources from the starter project into your project:

  • src/main/ic_launcher_round-web.png
  • src/main/ic_launcher-web.png
  • src/main/res/drawable/ic_gas.png
  • src/main/res/drawable/ic_lodging.png
  • src/main/res/drawable/ic_restaurant.png
  • src/main/res/drawable/ic_search_white.png
  • src/main/res/drawable/ic_shopping.png
  • src/main/res/mipmap/ic_launcher_round.png
  • src/main/res/mipmap/ic_launcher.png

Make sure to copy the files from all of the drawable folders, including everything with the .hdpi, .mdpi, .xhdpi and .xxhdpi extensions.

If you’re using the starter project, remember to replace the key in google_maps_api.xml and in the method setupPlacesClient() in MapsActivity.kt.

Bookmark categories

Assigning categories to bookmarks gives you the opportunity to show different icons on the map for each type of place. Google already provides category information for Places, so you’ll use this to set a default category, and let the user assign a different category if they choose.

Update the model

Start by adding a new category property to Bookmark.

Converting place types

If you examine Place defined by the Google Play Services, you’ll notice that it provides a fairly long list of place types:

Updating the view model

You’re ready to update the map’s view model to support bookmark categories.

Updating the UI

You can now update the user interface to show the category icons.

Searching for places

What if the user is looking for a specific place and can’t find it on the map? No worries! The Google Places API provides a powerful search feature that you’ll take advantage of next. You’ll add a new search button overlay on the map to trigger the search feature.

Use PlaceAutocomplete search

Open MapsActivity.kt and the following property to the companion object:

Update the UI

Next, you’ll surround the main map view with a frame Layout and add a floating search button on top of the map.

Create ad-hoc bookmarks

Google’s database of places is impressive, but it’s not perfect. What if the user wants to add a bookmark for a place that doesn’t show up on the map? You can make this possible by allowing the user to drop a pin at any location on the map.

Deleting bookmarks

Any full featured app needs to account for user mistakes. In PlaceBook, this means letting the user remove a bookmark that’s no longer needed or one that was added by accident. For this, you’ll add a trashcan action bar icon to the detail Activity to let the user delete a bookmark.

Sharing bookmarks

Your users have painstakingly bookmarked some fantastic places, so why not let them share their good finds with friends?

Color scheme

It’s a minor change, but updating the color scheme to match the bookmark icon colors will make the app look much better.

Progress indicator

It’s always good practice to let the user know when a potentially long-running operation is in progress. It also makes sense to prevent user interaction during this time. You’ll accomplish both of these tasks next.

Where to go from here?

Congratulations! You made it through the entire PlaceBook app section. You built a useful map-based app and learned a lot of new concepts along the way.

Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.
© 2026 Kodeco Inc.

You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now