1. Download our Official Android App: Forums for Android!

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

Discussion in 'Android Development' started by tamalsamui, Sep 18, 2017.

  1. tamalsamui

    tamalsamui Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Sep 18, 2017

    Sep 18, 2017
    3
    0
    5
    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
     

    Attached Files:


    Advertisement

  2. tamalsamui

    tamalsamui Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Sep 18, 2017

    Sep 18, 2017
    3
    0
    5
     
  3. tamalsamui

    tamalsamui Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    3
    Joined:
    Sep 18, 2017

    Sep 18, 2017
    3
    0
    5
    Code is below..


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



    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
     

Share This Page

Loading...