So I am working on a speech recognition program utilizing googles API. I am implementing this in the java based IDE, "Processing".
everything works fine, but I am trying to bypass the system error dialogue box that pauses the session until i click again (cant post an image but heres a link to the error dialogue):
http://www.pocketables.com/images/2013/06/didnt-catch-304x280.jpg
I've been digging into the API for hours, but im still at a loss how to disable this prompt.
EDIT: i've used the references supplied without much luck implementing it in Processing. Im not sure what I am missing. code below:
   import java.util.*;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.speech.SpeechRecognizer;
import android.speech.RecognitionListener;
/************************************************************************
 --------------------------------  DATAS ---------------------------------
 *************************************************************************/
PFont androidFont;
String [] fontList;
int VOICE_RECOGNITION_REQUEST_CODE = 1234;
  SpeechRecognizer recognizer;
Intent intent;
/************************************************************************
 --------------------------------  SETUP ---------------------------------
 *************************************************************************/
void setup() {
  orientation(LANDSCAPE);
  fontList = PFont.list();
  androidFont = createFont(fontList[0], 18, true);
  textFont(androidFont);
  PackageManager pm = getPackageManager();
  ArrayList<ResolveInfo> activities = (ArrayList<ResolveInfo>)pm.queryIntentActivities(
  new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
  if (activities.size() != 0) {
   // text("il y a un recognizer!", 20, 60);
  } 
  else {
    //text("Recognizer not present", 20, 60);
  }
}
/************************************************************************
 --------------------------------  DRAW ---------------------------------
 *************************************************************************/
void draw() {
}
/************************************************************************
 --------------------------------  EVENTS ---------------------------------
 *************************************************************************/
void mousePressed() {
  startVoiceRecognitionActivity();
}
void startVoiceRecognitionActivity() {
  intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
  intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
  intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speech recognition demo");
  startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);
}
@Override
void onActivityResult(int requestCode, int resultCode, Intent data) {
  recognizer = SpeechRecognizer.createSpeechRecognizer(this);
recognizer.setRecognitionListener(new listener());
               recognizer.startListening(intent);
  if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK) {
    background(0);
    // Fill the list view with the strings the recognizer thought it could have heard
    ArrayList<String>  matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
    String s[] = (String[]) matches.toArray(new String[matches.size()]);
    fill(255);
    for (int i=0; i<s.length; i++) {
      text(s[0], 60, 20);
      //println(s[i]);
    }
  }
  super.onActivityResult(requestCode, resultCode, data);
}
/*************RECOGNITION LISTENER CLASS*************************/
 class listener implements RecognitionListener {
    @Override
    public void onBeginningOfSpeech() {
       println("onBeginningOfSpeech");
    }
    @Override
    public void onBufferReceived(byte[] buffer) {
      println( "onBufferReceived");
    }
    @Override
    public void onEndOfSpeech() {
      println( "onEndOfSpeech");
    }
    @Override
    public void onError(int error) {
  startVoiceRecognitionActivity();
    println( "onError = " + error);
    }
    @Override
    public void onEvent(int eventType, Bundle params) {
      println( "onEvent");
    }
    @Override
    public void onPartialResults(Bundle partialResults) {
     println("onPartialResults");
    }
    @Override
    public void onReadyForSpeech(Bundle params) {
   println("onReadyForSpeech");
    }
    @Override
    public void onResults(Bundle results) {
    //ArrayList<String>  suggestedWords = results.getStringArrayList(RecognizerIntent.EXTRA_MAX_RESULTS);
    println( "results = " + results);
    }
    @Override
    public void onRmsChanged(float rmsdB) {
 //println( "onRmsChanged");
    }
}
