Skip to main content

Google app for Android updated with app-specific voice search API

Version 3.5 of the Google for Android application includes a new API that developers can take advantage of to activate “Ok Google” functionality within their own apps. According to the Android developer blog, software makers can add a few lines of code to their app to enable users to search it using a global voice command.

Once the feature has been integrated into an app (Talon, for example), users will be able to say things like “Ok Google, search for 9to5google in Talon” to trigger a search for that term within Talon.

How many lines of code will it take to let your users say Ok Google, and search for something in your app? Hardly any. Starting today, all you need is a small addition to your AndroidManifest.xml in order to connect the Google Now SEARCH_ACTION with your searchable activity:

<activity android:name=".SearchableActivity">
    <intent-filter>
        <action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
</activity>

Once you make these changes, your app can receive the SEARCH_ACTION intent containing the SearchManager.QUERY extra with the search expression.

The feature is available to all users on Android Jelly Bean and higher running the latest version of the free Google app. It currently only supports devices set to English.

FTC: We use income earning auto affiliate links. More.

You’re reading 9to5Google — experts who break news about Google and its surrounding ecosystem, day after day. Be sure to check out our homepage for all the latest news, and follow 9to5Google on Twitter, Facebook, and LinkedIn to stay in the loop. Don’t know where to start? Check out our exclusive stories, reviews, how-tos, and subscribe to our YouTube channel