I am finishing development of an application for Android to stream music from your personal music collection using DAAP and UPnP as well as other protocols at time permits.
My question is: How do I enable my app to respond to the new "Listen To" voice command in Android?
I have searched all over the place and can't figure it out.
I assume it's a broadcast receiver, but for the life of me, I can't find which one.
Any help is much appreciated.
Like the link @JoshLee mentioned explains, you just need to register your application's new intent in the application's manifest file "intent-filters" section such as:
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
and then make sure you:
import android.app.SearchManager;
you might also want to do something with the query so you can grab it like this:
String query = getIntent().getStringExtra(SearchManager.QUERY);
but you should probably encase that in a try/catch and handle any exceptions or cases where query == null.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With