25 Search

Your next task with PhotoGallery is to search photos on Flickr. You will learn how to integrate search into your app the Android way. Or, as it turns out, one of the Android ways. Search has been integrated into Android from the very beginning, but it has changed a lot over time.

In this chapter you will implement search using SearchView.

The user will be able to submit a query using the SearchView, which will search Flickr using the query string and populate the RecyclerView with the search results (Figure 25.1). The query string submitted 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 25.1  App preview

Get Android Programming: The Big Nerd Ranch Guide, 2nd Edition 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.