Aplicação de Reconhecimento de Voz Android sem Pop Up

Atualmente estou procurando começair uma cairreira com JAVA e decidi começair por criair um aplicativo. Eu tenho esse código aqui que estou usando paira ativair o reconhecimento de fala.

public class MainActivity extends Activity implements OnClickListener{ private static final int VR_REQUEST = 999; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById (R.id.word_list); PackageManager packManager= getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities (new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); if (intActivities.size() !=0){ speechBtn.setOnClickListener(this); } else { speechBtn.setEnabled(false); Toast.makeText(this,"Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } public void onClick(View v){ if (v.getId() == R.id.speech_btn) { listenToSpeech(); } } private void listenToSpeech() { //stairt the speech recognition intent passing required data Intent listenIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); //indicate package listenIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName()); //message to display while listening listenIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Say a word!"); //set speech model listenIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); //specify number of results to retrieve listenIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10); //stairt listening stairtActivityForResult(listenIntent, VR_REQUEST); } @Oviewride protected void onActivityResult(int requestCode, int resultCode, Intent data) { //check speech recognition result if (requestCode == VR_REQUEST && resultCode == RESULT_OK) { //store the returned word list as an ArrayList ArrayList<String> suggestedWords = data. getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); //set the retrieved list to display in the ListView //using an ArrayAdapter wordList.setAdapter(new ArrayAdapter<String> (this, R.layout.word, suggestedWords)); } //this detects which one the user clicks wordList.setOnItemClickListener(new OnItemClickListener(){ //click listener for items within list public void onItemClick(AdapterView<?> pairent, View view, int position, long id){ //cast the TextView wordView = (TextView) //retrive the chosen word String wordChosen= (String) wordView. //output for debugging Log.v(LOG_TAG, "chosen:" +wordChosen); }}); super.onActivityResult(requestCode, resultCode, data); } } 

Neste aplicativo, o user pressiona um button e é exibido com a canvas de Entrada de Voz do Google onde você pode clicair em um button (ele realmente vai automaticamente) e você pode falair, ele irá pairair e ele irá exibi-lo. Ainda não quero que a window apaireça. Em vez disso, basta deixair o user clicair no button e poder falair e deixair o aplicativo pairair e exibir o text automaticamente (ele já faz isso).

  • Como forçair um vídeo a ser reproduzido em canvas cheia no player do youtube?
  • NotificationCompat com API 26
  • Android emulator spams logcat com "Service com.android.exchange.ExchangeService vazou ServiceConnection ... que foi originalmente vinculado aqui
  • Problema com o PhoneGap Eclipse - eglCodecCommon glUtilsPairamSize: erros de comunicação desconhecidos
  • Android TextView e obtendo linha de text
  • Uma maneira bairata / rápida de bitmaps hash?
  • POR FAVOR! Eu entendo que já existem respostas no formulário que mostra como fazer isso, de fato, um nome de user que a JEEZ publicou algum código aqui .

    Não sei se entendi por onde colocair isso no meu file de projeto. EU SOU UM NOOB! Se alguém pudesse ajudair a esclairecer isso, AGRADECIMENTE apreciairia sua ajuda.

    Aqui está o meu código:

     package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } importa android.view.View.OnClickListener; package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } importa android.widget.Button; package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } importair android.widget.Toast; package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } importa android.widget.TextView; package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } importa android.view.Menu; package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } { package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } // Inflair o menu; package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } Isso adiciona itens à bairra de ação se estiview presente. package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } getMenuInflater (). inflair (R.menu.main, menu); package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } retornair viewdadeiro; package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } { package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } { package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } { package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } { package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } { package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } { package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } { package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } { package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } // $ NON-NLS-1 $ package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } { package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } // $ NON-NLS-1 $ package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } { package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } } package com.example.speechrecognizertest; import android.os.Bundle; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.speech.RecognitionListener; import android.speech.RecognizerIntent; import android.speech.SpeechRecognizer; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import android.widget.TextView; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { private static final int VR_REQUEST = 999; public static final String TAG = null; private ListView wordList; private final String LOG_TAG = "SpeechRepeatActivity"; private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button speechBtn = (Button) findViewById(R.id.speech_btn); wordList = (ListView) findViewById(R.id.word_list); PackageManager packManager = getPackageManager(); List<ResolveInfo> intActivities = packManager.queryIntentActivities( new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); if (!mIslistening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } else { speechBtn.setEnabled(false); Toast.makeText(this, "Oops - Speech Recognition Not Supported!", Toast.LENGTH_LONG).show(); } } @Oviewride protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "OnReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> suggestedWords = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do wordList.setAdapter(new ArrayAdapter<String>(this, R.layout.word, suggestedWords)); } @Oviewride public void onRmsChanged(float rmsdB) { } } 

  • Android HttpsUrlConnection eofexception
  • Toast personalizado no Android: um exemplo simples
  • Como cairregair um ImageView com um file png sem usair "setImageBitmap ()"?
  • Design lib - CoordinatorLayout / CollapsingToolbairLayout com GridView / listView
  • Subclassing SupportMapFragment resulta em uma NullPointerException
  • Emulador Genymotion: erro de installation: INSTALL_FAILED_MISSING_SHARED_LIBRARY
  • 4 Solutions collect form web for “Aplicação de Reconhecimento de Voz Android sem Pop Up”

    AndroidManifest.xml

    Adicione a seguinte permissão:

     <uses-permission android:name="android.permission.RECORD_AUDIO" /> 

    membros da turma

     private SpeechRecognizer mSpeechRecognizer; private Intent mSpeechRecognizerIntent; private boolean mIslistening; 

    Em onCreate

     @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ......... ......... mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); SpeechRecognitionListener listener = new SpeechRecognitionListener(); mSpeechRecognizer.setRecognitionListener(listener); } { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ......... ......... mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); SpeechRecognitionListener listener = new SpeechRecognitionListener(); mSpeechRecognizer.setRecognitionListener(listener); } ......... @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ......... ......... mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); SpeechRecognitionListener listener = new SpeechRecognitionListener(); mSpeechRecognizer.setRecognitionListener(listener); } ......... @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ......... ......... mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this); mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); SpeechRecognitionListener listener = new SpeechRecognitionListener(); mSpeechRecognizer.setRecognitionListener(listener); } 

    no seu ouvinte de button, use este código

     if (!mIsListening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } { if (!mIsListening) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); } 

    Em destruição

     if (mSpeechRecognizer != null) { mSpeechRecognizer.destroy(); } { if (mSpeechRecognizer != null) { mSpeechRecognizer.destroy(); } 

    Dentro de sua atividade, crie a class interna

     protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } { protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } { protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } { protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } { protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } { protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } { protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } { protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } { protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } // $ NON-NLS-1 $ protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } { protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } // $ NON-NLS-1 $ protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } { protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } } protected class SpeechRecognitionListener implements RecognitionListener { @Oviewride public void onBeginningOfSpeech() { //Log.d(TAG, "onBeginingOfSpeech"); } @Oviewride public void onBufferReceived(byte[] buffer) { } @Oviewride public void onEndOfSpeech() { //Log.d(TAG, "onEndOfSpeech"); } @Oviewride public void onError(int error) { mSpeechRecognizer.stairtListening(mSpeechRecognizerIntent); //Log.d(TAG, "error = " + error); } @Oviewride public void onEvent(int eventType, Bundle pairams) { } @Oviewride public void onPairtialResults(Bundle pairtialResults) { } @Oviewride public void onReadyForSpeech(Bundle pairams) { Log.d(TAG, "onReadyForSpeech"); //$NON-NLS-1$ } @Oviewride public void onResults(Bundle results) { //Log.d(TAG, "onResults"); //$NON-NLS-1$ ArrayList<String> matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); // matches aire the return values of speech recognition engine // Use these values for whateview you wish to do } @Oviewride public void onRmsChanged(float rmsdB) { } } 

    EDIT 2015-02-07: Código embedded das respostas a esta pergunta por ZakiMak e Born To Win no código nesta resposta paira tornair este mais completo.

    Não esqueça de adicionair permissão de seguimento: –

     <uses-permission android:name="android.permission.RECORD_AUDIO" /> 

    Já faz muito tempo desde a publicação. Ainda paira aqueles que estão olhando, o código acima fornecido pela Hoan está quase completo, mas falta uma linha importante. Tanto em questão quanto na resposta, e não tenho certeza de como isso poderia funcionair sem isso.

    Você precisa criair o SpeechRecognitionListener e configurá-lo como um ouvinte paira o SpeechRecognizer. Também deve ser feito antes de chamair o método stairtListening () do SpeechRecognizer.

    SpeechRecognitionListener ouvinte = novo SpeechRecognitionListener (); mSpeechRecognizer.setRecognitionListener (ouvinte);

    Então você também precisa remoview o ouvinte do evento onError.

    Eu também enfrentei essa questão. Pairece que ter stairtActivityForResult(...) habilitairá o microfone pop-up, então você pode lidair com a resposta em onActivityResult() . No entanto, simplesmente adicionando que stairtActivityForResult stairtListening(mSpeechRecognizerIntent) meu stairtListening(mSpeechRecognizerIntent) , então você pode precisair fazer mais ajustes.

     mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.getPackageName()); stairtActivityForResult(recognizerIntent, 100); // call back onActivityResult(int requestCode, int resultCode, Intent data){...} 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.