Not getting RecognizerIntent result codes

by pac » Fri, 23 Apr 2010 01:18:44 GMT


Sponsored Links
 I want to get the RecognizerIntent result codes such as
RESULT_SERVER_ERROR because I want to distinguish between the cases
where the speech wasn't understood or no matches were found and the
cases where recognition didn't occur because of connection or server
problems.

When onActivityResult() executes, however, the result code is either
RESULT_OK or 0.  I never catch any of the various RecognizerIntent
result codes.  What do I need to do?

Here's my code:

  private void startVoiceRecognitionActivity() {
        Intent intent= new
Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                        RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
        intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Say something!");
        startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);
    }

    protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
        if (requestCode == VOICE_RECOGNITION_REQUEST_CODE &&
resultCode == RESULT_OK) {
              // do stuff
        }
        else if (requestCode == VOICE_RECOGNITION_REQUEST_CODE &&
resultCode != RESULT_OK) {

                // Figure out the error
                String err = "";
                switch (resultCode) {
                case (RecognizerIntent.RESULT_AUDIO_ERROR):
                        err = "Audio error";
                break;
                case (RecognizerIntent.RESULT_CLIENT_ERROR):
                        err = "Client error";
                break;
                case (RecognizerIntent.RESULT_NETWORK_ERROR):
                        err = "Network error";
                break;
                case (RecognizerIntent.RESULT_NO_MATCH):
                        err = "No match";
                break;
                case (RecognizerIntent.RESULT_SERVER_ERROR):
                        err = "Server error";
                break;
                }
       }
        super.onActivityResult(requestCode, resultCode, data);
    }

--



Other Threads

1. Pre Order T-SHIRT ANDROID - Cyanogen

Kepada rekan2 yang berminat...buruan, Proses Pre-Order tetap berjalan
langsung kontak ke email : spu...@gmail.com untuk pemesanan.

Dibuka Pre Order T-SHIRT ANDROID CYANOGEN MOD 7

Proses pemesanan dibagi menjadi 4 bagian :
Proses pesan : 19 - 31 Maret 2011
Proses Transfer 1 - 10 April 2011
Proses Produksi : 11 - 29 April 2011
Pengiriman : 30 April 2011

Penampakan :
Silahkan cek di :
http://i786.photobucket.com/albums/yy142/spurwa/KaosCyanogenFB.jpg

Pemesanan Menggunakan Format :
FORM ISIAN
Email :
Nama Asli :
Contact Person (HP) :
Alamat lengkap (Harus Lengkap):
Desain : T-SHIRT Cyanogen
Ukuran :
Jumlah :

Kirim ke Inbox FB atau Email

Proses transfer akan dilakukan setelah quota memenuhi sebanyak min 25
Orang/Desain

Harga Per pcs nya : 70.000 (diluar Ongkos kirim)

Bahan : cotton 20 S
Logo dan Tulisan Sablon Plastisol

Ukuran :
S : ukuran dada 44 cm ukuran panjang 65 cm
M : ukuran dada 51 cm ukuran panjang 69 cm
L : ukuran dada 54 cm ukuran panjang 71 cm
XL : ukuran dada 58 cm ukuran panjang 74 cm
XXL : ukuran dada 60 cm ukuran panjang 77 cm
XXXL : ukuran dada 61,5 cm ukuran panjang 78,5 cm

Kirimkan VIA Message di Facebook aja...
Contact :
SMS : 082115242235
Email : spu...@gmail.com
facebook : spu...@gmail.com

Proses Transfer dilakukan VIA Bank Mandiri

-- 
===============

2. Beta Tester Infrastructure Project

Over the course of the last year or so I created a beta tester
infrastructure to help me test my new paid apps in the Android
market.

The infrastructure allows me to provision a list of beta users for an
app and provides beta test codes for them to use.  I add a small jar
to my project and a single line of code to launch the beta login
activity.

I'm trying to decide whether it makes sense for me to expand the
infrastructure so that other developers can use it too.  If you're
interested click through to a Google form I set up and leave your
email address.

P.S. I'm not a spammer, but feel free to leave a throwaway address if
you're not convinced.

http://bit.ly/hwXnNF

-- 

3. Can't solve this problem.

4. Pre Order T-SHIRT ANDROID - Cyanogen Mod 7

5. How do i upload the file from android mobile to public server

6. creating a driver application

7. Email To field not displaying