Developers can add “OK Google” support with only 6 lines of code

One of the best upcoming features of Android is the handsfree “OK Google” voice activation and Google has posted a cheat sheet on how to bring the voice search to your App.

All it takes is a small addition to the AndroidManifest.xml in order to connect to Google Now using the following code:

<activity android:name=".SearchableActivity">
        <action android:name=""/>
        <category android:name="android.intent.category.DEFAULT"/>

Once implemented, users can simply say “Ok Google, search Pizza on Eat24”.

So if you’re a developer, drop us a comment below – did you think it was this quick to add “Ok Google” support?

Note: Select outbound links may include affiliate tracking codes. Revenue generated from any potential purchases is used to fund AndroidGuys. Read our policy.