• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Google Voice Integration to App: Google unable to open my application

tamalsamui

Lurker
Sep 18, 2017
3
0
I am trying to search my app using google now voice command like: 'Search something on APP_NAME'.


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>And I am using it for my app Pluto (https://play.google.com/store/apps/details?id=com.tamal.voicesearch). Now the problem is this voice search was working 2 weeks back (for my other apps). Now it is not working in some of my devices but in some it is working. More interestingly in all these devices voice search is working for application like Flipkart.</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>One weird solution:</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>I spend a complete day on researching on this issue and then cleared the data of my Google app and uninstall the Updates and suddenly it started working on my Samsung S4 device (Android version: 5.0.1 and Google App version 7.8.22.21 ), please check the attachment. But in my other 2 devices Moto G4 (Android version: 7.0.0) and Nexus 5 (Android version: 6.0.1) it is still not working (even after clearing data and uninstalling updates of Google App). If I say 'Search something on Pluto', it is doing web search.</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>I have researched but didn't get any explanation or solution for this behavior yet. Not understanding this inconsistency at all. I am using the following in documentation for the same:</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>https://developer.android.com/guide/components/intents-common.html#Search</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>https://www.youtube.com/watch?v=PS1FbB5qWEI</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>My code is very simple.. the the following in the manifest..</p>


&lt;activity android:name='.SearchableActivity'&gt; &lt;intent-filter&gt; &lt;action android:name='com.google.android.gms.actions.SEARCH_ACTION'/&gt; &lt;category android:name='android.intent.category.DEFAULT'/&gt; &lt;category android:name='android.intent.category.VOICE' /&gt; &lt;/intent-filter&gt; &lt;/activity&gt;


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>And in Activity fetching the Query string..</p>


if (intent != null &amp;&amp; ACTION_VOICE_SEARCH.equals(intent.getAction())) { String query = intent.getStringExtra(SearchManager.QUERY); }


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>And</p>


compileSdkVersion 26
 

Attachments

  • motog4_not-working.png
    motog4_not-working.png
    38.3 KB · Views: 112
  • samsung s4_working.png
    samsung s4_working.png
    12.5 KB · Views: 85
I am trying to search my app using google now voice command like: 'Search something on APP_NAME'.


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>And I am using it for my app Pluto (https://play.google.com/store/apps/details?id=com.tamal.voicesearch). Now the problem is this voice search was working 2 weeks back (for my other apps). Now it is not working in some of my devices but in some it is working. More interestingly in all these devices voice search is working for application like Flipkart.</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>One weird solution:</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>I spend a complete day on researching on this issue and then cleared the data of my Google app and uninstall the Updates and suddenly it started working on my Samsung S4 device (Android version: 5.0.1 and Google App version 7.8.22.21 ), please check the attachment. But in my other 2 devices Moto G4 (Android version: 7.0.0) and Nexus 5 (Android version: 6.0.1) it is still not working (even after clearing data and uninstalling updates of Google App). If I say 'Search something on Pluto', it is doing web search.</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>I have researched but didn't get any explanation or solution for this behavior yet. Not understanding this inconsistency at all. I am using the following in documentation for the same:</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>https://developer.android.com/guide/components/intents-common.html#Search</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>
</p>


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>My code is very simple.. the the following in the manifest..</p>


&lt;activity android:name='.SearchableActivity'&gt; &lt;intent-filter&gt; &lt;action android:name='com.google.android.gms.actions.SEARCH_ACTION'/&gt; &lt;category android:name='android.intent.category.DEFAULT'/&gt; &lt;category android:name='android.intent.category.VOICE' /&gt; &lt;/intent-filter&gt; &lt;/activity&gt;


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>And in Activity fetching the Query string..</p>


if (intent != null &amp;&amp; ACTION_VOICE_SEARCH.equals(intent.getAction())) { String query = intent.getStringExtra(SearchManager.QUERY); }


<p dir='ltr' style='margin-top:0; margin-bottom:0; text-align:start;'>And</p>


compileSdkVersion 26
 
Upvote 0
Code is below..


My code is very simple.. the the following in the manifest..


&lt;activity android:name='.SearchableActivity'&gt;
&lt;intent-filter&gt;
&lt;action android:name='com.google.android.gms.actions.SEARCH_ACTION'/&gt;
&lt;category android:name='android.intent.category.DEFAULT'/&gt;
&lt;category android:name='android.intent.category.VOICE' /&gt;
&lt;/intent-filter&gt;
&lt;/activity&gt;


And in Activity fetching the Query string..


if (intent != null &amp;&amp; ACTION_VOICE_SEARCH.equals(intent.getAction())) {
String query = intent.getStringExtra(SearchManager.QUERY);
}


And


compileSdkVersion 26
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones