1

Generally we can recognize speech by this intent:

Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, locale.toString());
try {
    startActivityForResult(intent, RESULT_SPEECH);
} catch (ActivityNotFoundException a) {}

But I'd like to implement call with ok-google style, when you don't need to define language to recognize.

Aleksandr
  • 787
  • 6
  • 22

1 Answers1

0

As noted in another answer, there is no easy way to call custom app actions. If you can stick to one of predefined system actions, implementation should be straightforward (intercept relative broadcast Intent) but if you're going to have your own specific, you should ask for a Custom one

Community
  • 1
  • 1
Shine
  • 3,788
  • 1
  • 36
  • 59