Ask for PockteSphinxAndroid source code
<p>I'm looking for to modify the source Java code of the Android App for offline Speech recgonition called "PocketSphinxDemo" (probably someone of you knows it!) to allow the speech recognizer Thread to be active without the pressure on the touchscreen  that create the event Action_DOWN and the release of the button that create an Action_UP event. This is necessary for my application because i need that the rec operation starts when the app goes to run. After many trials, the app doesn't work; primarily i "delete" the "switch case" construct where is located the start of the thread and successively i delete the implements of the onTouch listener. Can you help me please? </p>

<p>This is the part of the code that i modified. </p>

<pre><code>   public class PocketSphinxAndroidDemo extends Activity  {
    static {
        System.loadLibrary("pocketsphinx_jni");
    }

/**
 * Recognizer task, which runs in a worker thread.
 */
RecognizerTask rec;
/**
 * Download data
 * 
 */


DownloadData downloader;
/**
 * Thread in which the recognizer task runs.
 */
Thread rec_thread;
/**
 * Time at which current recognition started.
 */
Date start_date;
/**
 * Number of seconds of speech.
 */
float speech_dur;
/**
 * Are we listening?
 */
boolean listening;
/**
 * Progress dialog for final recognition.
 */
ProgressDialog rec_dialog;
/**
 * Performance counter view.
 */
TextView performance_text;

TextView which_pass;
/**
 * Editable text view.
 */

final static int ACTIVITY_CREATE = 1;

EditText words;
EditText number;
EditText digit;
EditText activeField;
String activeFieldStr = "";

private ProgressDialog pd;
private final static String PS_DATA_PATH = Environment.getExternalStorageDirectory() + PreferenceConstants.PREFERENCE_BASE_PATH;





     abstract class Implementazione implements Runnable, RecognitionListenerReduced {
private Object activeField;

private Object which_pass;
private boolean listening;

private Runnable rec_thread;

private Runnable rec;



private float speech_dur;

private ProgressDialog rec_dialog;

private Object Date;



    public void start() {


        ((TextView) this.activeField).setText("");

        ((TextView) this.which_pass).setTextColor(Color.RED);
        ((TextView) this.which_pass).setText("First Pass");
        start_date = new Date();
        this.listening = true;
        /*
         * Starts the RecognizerTask's thread, which will start listening and analyzing the 
         * audio
         */
        rec= new Thread(this);
        ((RecognizerTask) this.rec).start();
    this.rec_thread = new Thread(this.rec);

    ((RecognizerTask) this.rec).setRecognitionListener(this);
    ((RecognizerTask) this.rec_thread).start();


    ((RecognizerTask) this.rec).stop();



}
</code></pre>
