Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Speech Recognition is not working in Android 11+

I using speech recognition google API its working fine in Android 10 and below but unfortunately stop working after updating API to android 30, and
Method Provide null result

  @Override
   public void onPartialResults(Bundle partialResults) {
          ArrayList<String> stringArrayList = partialResults.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
          String result;
           if (stringArrayList != null) {
                result = stringArrayList.get(0);
                String stringBuilder = oldText + result;
                editText.setText(stringBuilder);
                editText.setSelection(editText.getText().length());
           }
  }

and logcat response

E/SpeechRecognizer: bind to recognition service failed

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The problem seems to be related to this new Android 11 "feature", and the solution could be to add a query to the manifest for the blocked intent :

<manifest ...>
    <queries>
        <intent>
            <action android:name="android.speech.RecognitionService" />
        </intent>
    </queries>

Please let me know the results.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading