I finally manage to use Android plugin In unity...but...!!!
fail to use speak recognize api which i succeed in android native app. when i succeed in Toast.show() in unity , I thought it would be really easy for me to speak recognize api but it dosent' work.
in unity, if I press certain button it call android's below method in plugin code. (android ) where unity call this method ,
m_UnityActivity.runOnUiThread(new Runnable() { public void run() { android.widget.Toast.makeText(m_UnityActivity, "1", android.widget.Toast.LENGTH_SHORT).show(); } }); sr.setRecognitionListener(new listener()); m_UnityActivity.runOnUiThread(new Runnable() { public void run() { android.widget.Toast.makeText(m_UnityActivity, "2", android.widget.Toast.LENGTH_SHORT).show(); } }); Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,"voice.recognition.test"); intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS,5); sr.startListening(intent);
unity end up toasting 1 but not 2. in listener class, It comes till constructor( i confirm in constructor by toasting message) but seems that dosen't come out of listener class...
what is wrong? I 'don't understand. in manifest which I included in Unity asset-Plugins- Android, I included audio permission.
Your answer
![](https://koobas.hobune.stream/wayback/20220612094042im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity Google Play Services 2 Answers
Player Settings messed and merged together 0 Answers
XR Plug-in Manager won't check Oculus box 0 Answers
Save Plugins outside Assets/Plugins 0 Answers