// Note: This program continuously requires bandwidth while running. // It will also keep running in the background, even with the display // off. Swipe the JavaX app away in the task switcher to terminate. !7 import android.graphics.Color; static TextView tv, tvStatus; please include function aContinuousEnglishRecognition. p { makeBot("Recognizer."); makeMyselfAware(); androidUI(r { tvStatus = aTextView("Preparing..."); tvStatus.setTextSize(20); tvStatus.setGravity(Gravity.CENTER); tvStatus.setTextColor(Color.RED); tv = aTextView(); tv.setTextSize(40); tv.setGravity(Gravity.CENTER); tv.setTextColor(Color.BLACK); androidShow(aNorthAndCenter(tvStatus, tv)); }); new ContinuousEnglishRecognition rec; rec.onSpeech = f onSpeech; rec.onReady = r { aSetText(tvStatus, "Listening.") }; rec.onUnready = r { aSetText(tvStatus, "Hold on...") }; rec.start(); } sS last = ""; static long time; static void onSpeech(L l) { S s = first(l); //S ss = dropPrefixTrim(last, s); S ss = joinLines(takeLast(10, javaTokC(s))); last = s; time = now(); print("> " + ss); if (nempty(ss)) aSetText(tv, ss); } answer { if "text" ret now() + ": " + last; }