I'm developing an application that uses the voice recognition service provided by Google. The language used by default is set in the device and it is returned by Locale.getDefault(), so I would allow the user to set one of the supported languages for speech recognition.
For this reason I need to get a list of languages supported by the recognition engine. I read this simple example (http:// developer.android.com/resources/samples/ApiDemos/src/com/example/ android/apis/app/VoiceRecognition.html) and I saw that for this purpose, the sendOrderedBroadcast method is invoked. The above method is asynchronous, therefore the results are received by a BroadcastReceiver (in this case the receiver is an instance of the SupportedLanguageBroadcastReceiver private class). I would let the user choose the preferred language before the activity of speech recognition starts, but the above method is asynchronous. What are the solutions to this problem? - I could use a timer: when this timer expires, if the SupportedLanguageBroadcastReceiver has not received any response, then the default language is used. Can I use a timer? If yes, how can I use a timer? - Or, can I achieve the same goal using some method that is not asynchronous? Generally what solution is adopted? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

