Google has just publicized an awesome feature for developers who want their apps to be searchable using the “OK Google” voice command. Putting 6 simple lines of code in your manifest file will enable Google Search to allow voice searches that originate from users using the command. Here are a couple of examples:
- “Ok Google, search pizza on Eat24”
- “Ok Google, search for hotels in Maui on TripAdvisor”
And here’s the line of code you’ll need to add to the AndroidManifest.xml file:
<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>
And that’s it. As long as your app has a searchable activity users can initiate the command and search like they would through Google’s own search engine (though you’ll need to be using English and have Google Search version 3.5 or higher installed on phones or tablets with Jelly Bean or higher). Can’t wait to see this make its way into many of the great apps in Google Play!
[via Google]
I’m still waiting for voice controls over the entire phone. I want to be able to turn volume up, down, skip songs, etc. Slacker is slacking
Tasker is your best bet for that. Root and buy it along with a few other apps.
Kinect phone?
So I am a little confused as to what this does? By adding this to my manifest, does it mean that I could for instance in my checkbook app, say “Ok Google, what are my upcoming bills” and have it then search my app and return what my bills due are? Or is this just allowing me to do a web search from within my application using the “ok google”?
Honestly, I think it is just so that your app comes up when you say “Ok Google open such and such app”. I don’t see how this simple line of code could do much beyond that but I’ve been wrong before.
It’s not necessarily a web search. If the app has that specific search, this will enable use of it through ‘OK Google’.
E.g. searching for your team on a sports app. Searching for a gas station on gas buddy. Searching for a movie through Flixster/movie app. Etc.
This is for app developers. You can’t just change a manifest file of any app but if you are developing an app with a search function you can enable Google voice search to automatically open your app and search it.
I love using “OK Google” outside of the Google search bar. I just figured out how to activate it on my LG G2: On-Screen Phone was activated and apparently that turns off the microphone so you can’t set it up. I’m excited to see how far these voice controls will go (like the examples in the article).