If you’ve managed to get your hands on a BlackBerry® smartphone running BlackBerry® 6 (or a simulator of one), one of the first things you may have noticed is the new Home Screen interface. The new slider panes like Favorites and Frequent aren’t just fun to play with, but make it really easy for users to find their most frequently-used applications.
However, the best timesaver of all is the Unified Search framework, which is built right into the interface. Simply tap on the Search icon on the top right to bring up the Search field – or better yet, simply start typing directly on the home screen – and the search field will appear and populate automatically. With Unified Search, a user’s hunting days are over. Just start typing the name of the app on the home screen and the results will filter as they type.
Here’s an example of how I found and launched my “Hello World” app:
Now you might have noticed the additional Search Options within the last screenshot, such as “Search YouTube” and “Search BlackBerry App World™”. These are what we like to call External Search Providers, and luckily for us, the BlackBerry Unified Search API allows any application to register itself as an External Search Provider. In a lot of cases, your application might already have a remote search service accessible over the web or a built-in search engine. By simply implementing the ExternalSearchProvider interface, your application can register and place its own customized icon within the Unified Search Framework. Once the user clicks on your icon, your application gets passed to the search query from the home screen, and it can then perform the search operation in its own way seamlessly. This is what we call Click-To-Search integration, and it’s perfect for search operations that are expensive or might take a while to complete.
The most important thing to remember when implementing the ExternalSearchProvider is to decide what type of content type(s) it will be searching. It is important to specify meaningful and relevant content types as this will directly impact where your application’s search icon appear(s) on the device. In addition, this will assist other third party clients using the Unified Search framework to provide relevant search options from within their applications. If relevant, feel free to combine multiple content types using bitwise parameters.
For example, a music store application should specify its’ content type as CONTENT_TYPE_MEDIA_MUSIC to ensure that its Search icon appears within the music library. Additionally, this allows other applications on the BlackBerry smartphone (like a radio player, perhaps) to query the Unified Search framework for a list of registered music search providers, so that it can extend additional capability (like purchasing) to those applications. This will be covered in more depth in a later post.
Here’s an example of how a music store with its own remote search engine could integrate using the ExternalSearchProvider interface:
Here’s the Documentation and Code Sample for ExternalSearchProvider.
If you’ve had a chance to try developing with the ExternalSearchProvider, we’d like to hear about it. What have your experiences been like?