developer

Add Features

The following sections discuss the various features that you can add to your app with the Android SDK:

Show App and Contact Suggestions

In addition to keyword search suggestions, you can enable local suggestions for apps and contacts on your phone.

To enable apps suggestions, call the showAppSuggestions method:

builder.showAppSuggestions(true);

To enable apps suggestions, call the showContactSuggestions method:

builder.showContactSuggestions(true);

Type tag for YHS experimentation

Developers can perform experiments, or segment traffic and revenue between different entry points within their apps. If specified, the TYPE_TAG attribute will associate corresponding search traffic and revenue with the desired label, which can then be accessed by Yahoo Partner Managers.

SearchActivity.IntentBuilder builder = new SearchActivity.IntentBuilder();
builder.setTypeTag("TYPE_TAG");
Intent i = builder.buildIntent(context);
startActivity(i);

Show Search History

In addition to trending suggestions, users will see the search history when the query field is empty. Search history is enabled by default.

To change the number of search history items to be shown, call the setNumberOfHistoryItems method:

builder.setNumberOfHistoryItems(5);

Note

The number of history items should be greater or equals than 0. An IllegalArgumentException will be thrown otherwise. “Show All History” option is available below set number of history items. On tap of this label you can see maximum of hundred history items.

Integrate native ads

The Search SDK can display Gemini native ads within the Image vertical search interface. To enable proper revenue attribution, set your Flurry API key using setupFlurryAds. For more information on registering with Flurry to enable Gemini ads, refer to the Get Started section to create your API key. You will also need to create an ad space and define your ad space name which will be passed in the API as below.

SearchSDKSettings.Builder builder = new SearchSDKSettings.Builder(#YOUR_DEV_APPID);
builder.setupFlurryAds(#YOUR_FLURRY_API_KEY, #YOUR_AD_SPACE_NAME);