I want to open the Android Keyboard in Speaking mode by default programmatically when I focus on editText.
I know android:inputType="voice" is in enhancement, is there
another way?
I don't want to use SpeechRecognizer because the difference with the one used by default in Android keyboard is that it works offline.
Related
Thanks in advance for the help.
I am developing an android application for research purposes and need to disable the speech to text button on the soft input keyboard. The reason for this is due to concurrency issues that arise since the application I am developing uses the microphone. I understand that for a general application disabling keys is generally seen as impossible (since users may change default keyboards). I know for a fact that the default keyboard will be used.
With this in mind is it possible to disable certain keys? I believe that at the least I should be able to specify the input type such that the microphone button is hidden. I say this because if I disable speech to text in the settings (not programmatically, but manually as a user) the microphone icon is removed from the keyboard. I'm open to any possible solution (with the exception of not using the default keyboard) as this application will not appear on the play store.
You can't force the user input through anything other than pre-defined keyboards that already exist in the user's device.
The only way you could get around this is by programming your own custom, on-the-fly keyboard, and that is a very bad idea.
Just disable voice input programmatically by using XML declarations in the EditText you're looking at. You can do this with the attribute:
android:privateImeOptions="nm" // nm stands for No Microphone.
If you want to set it programmatically you can try this::
// deprecated i guess
edt_txt.setPrivateImeOptions("nm");
// this one is new but it works only with Google Keyboard.
edt_txt.setPrivateImeOptions("com.google.android.inputmethod.latin.noMicrophoneKey");
You can combine values in PrivateImeOptions parameter in CVS form so best option is to use:
edt_txt.setPrivateImeOptions("nm,com.google.android.inputmethod.latin.noMicrophoneKey");
Take a look through here and see if you can find what you're looking for.
More info about Google Keyboard here -> look for method setOptions
To disable microphone button on multiple keyboard. Use property
android:privateImeOptions="nm"
But it will not work for Gboard(google native keyboard)
To disable on microphone on Gboard use
android:privateImeOptions="nm"
editText.setImeOptions(IME_FLAG_NO_PERSONALIZED_LEARNING)
Just use this in your editText on the layout file:
android:imeOptions="flagNoPersonalizedLearning"
I have an application that works fine with android "original" default keyboard but has issues with some custom keyboards.
Is it possible to always pop-up the android "original" keyboard regardless the has user installed a custom keyboard?
I know the best way is to write my own keyboard class but currently I don't have the time and I need a quick fix.
Thanks.
I am writing a mobile HTML5 web application to run on both Apple and Android. On the Android device I am testing on, I am having the following issue:
I have an input web control text box located in the lower 50% of the screen. When the focus goes to the text box, the soft keyboard is displayed and obscures/covers up/hides the input web control for which the user is supposed to be typing into. Only when the user types in at least one character does the input web control become visible and no longer hidden underneath the keyboard.
What I want is for the field being entered NOT to be obscured by the keyboard. When the soft keyboard is displayed, I want the input web control to remain visible.
This is on a Samsung tablet running Android version 3.2.
Please tell me how to accomplish this.
The simplest way to solve this android (and now ios7 too) nasty is to use the inputs focus and blur events. if you don't have a footer tag change to a class.
In jQuery:
$("input").focus(function(){
$('footer').hide();
});
$("input").blur(function(){
$('footer').show();
});
I thought about implementing kind of a meta-soft-keyboard for android that first checks if a physical keyboard is connected (in my case a dock but bluetooth kbds should also be possible) and launches a specific other soft-keyboard if there isn't.
So:
Is there a way to get a list of all installed keyboards using the android API?
/edit: This seems to be possible using the InputMethodManager
Can I then call a specific one of these keyboards?
If there is no API solution, can it possibly be done on rooted phones/tablets?
Or do I have to implement my own full keyboard solution (or possibly fork/improve an existing open source one) that just doesn't pop up when there's a physical kbd connected)?
For those having similar troubles:
The best work-around solution I found so far is using the NULL keyboard and the Dock keyboard switcher apps. But the NULL keyboard currently only supports the english layout and the constant keyboard switcher popup gets kind of annoying... (IMO it's almost easier to just hide the keyboard everytime it appears)
Seems like it can be done by public boolean switchToNextInputMethod (IBinder imeToken, boolean onlyCurrentIme), but I don't know is it switching permanently or only for one time and this method is added only in Jelly Bean.
I am developing an Android application. What I find most annoying during testing is, that the emulator always pops up that on-screen telephone keyboard whenever I click into a text input field. Since I input my data with the keyboard anyway I find that most annoying. Can one switch that on-screen keyboard appearance off? Or can one change that so that it at least presents a mini-qwerty keyboard as my actual device does, not that old-fashioned T9 keyboard?
Michael
You can disable the virtual keyboard in Settings->Language.
If you change orientation of the emulator it won't popup (KEYPAD_7, Ctrl-F11).
If you use cursor keys instead of clicking the fields, probably won't popup either.
Whatever you do, keep in mind that in actual devices it usually pops up anyway.