Search code examples
androidinputvoice-recognitionandroid-inputtype

Detect if voice typing is enabled


I need to display an alert to the user if they haven't enabled Google voice typing from their settings(Language and input -> Google voice typing). Is there someway to detect that setting status?


Solution

  • So i found my answer. There is no official way of detecting wether voice typing is enabled or not. I have managed to get a list of enabled input methods ( keyboard, voice, etc).

    String enabledMethods = Settings.Secure.getString(getActivity().getContentResolver(),Settings.Secure.ENABLED_INPUT_METHODS);
    

    There we can see if Google voice typing is enabled or not and we can alert the user to turn it on, however this applies for the default keyboard. Some users use custom keyboards that have their own implementation of speech to text and it doesn't relly on the users settings for Google voice typing. So it will be a false positive for them.