In September, we launched a new way to search for content in apps on Android phones. With this update, users were able to find personal content like messages, notes, music and more across apps like OpenTable, Ticketmaster, Evernote, Glide, Asana, Gmail, and Google Keep from a single search box. Today, we're inviting all Android developers to enable this functionality for their apps.
Starting with version 10.0, the Firebase App Indexing API on Android lets apps add their content to Google's on-device index in the background, and update it in real-time as users make changes in the app. We've designed the API with three principles in mind:
- making it simple to integrate
- keeping all personal data on the device
- giving the developer full control over what goes into the index and when
There are several predefined data types that make it easy to represent common things such as messages, notes, and songs, or you can add custom types to represent additional items. Plus, logging user actions like a user listening to a specific song provides an important signal to help rank user content across the Google app.
Indexable note = Indexables.noteDigitalDocumentBuilder()
.setUrl("http://example.net/users/42/lists/23")
.setName("Shopping list")
.setText("steak, pasta, wine")
.setImage("http://example.net/images/shopping.jpg")
.build();
FirebaseAppIndex.getInstance().update(note);
Integrating with Firebase App Indexing helps increase user engagement with your app, as users can get back to their personal content in an instant with Google Search. Because that data is indexed directly on the device, this even works when offline.
To get started, check out our implementation guideand codelab.