O'Reilly logo

Android Programming: The Big Nerd Ranch Guide, Third Edition by Kristin Marsicano, Chris Stewart, Bill Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

27 Search

Your next task with PhotoGallery is to search photos on Flickr. You will learn how to integrate search into your app using SearchView. SearchView is an action view class – a view that can be embedded right into your Toolbar.

The user will be able to press on the SearchView, type in a query, and submit it. Submitting the query will send the query string to Flickr’s search API and populate the RecyclerView with the search results (Figure 27.1). The query string itself will be persisted to the filesystem. This means the user’s last query will be accessible across restarts of the app and even the device.

Figure 27.1  App preview

Searching Flickr

Let’s begin with the Flickr side of things. To search ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required