Code example for SpeechRecognizer

Methods: startListening

0
            if (!service.packageName.equals(PROVIDER_PACKAGE_NAME))
                continue; 
 
            int versionCode;
            try { 
                versionCode = pm.getPackageInfo(service.packageName, 0).versionCode;
            } catch (NameNotFoundException e) {
                continue; 
            } 
 
            if (versionCode < PROVIDER_MIN_VERSION)
                continue; 
 
            mRecognitionProvider = new ComponentName(service.packageName, service.name);
 
            return true; 
        } 
 
        // If we reach this point, we failed to find a suitable recognition provider. 
        return false; 
    }