Add my own custom keyboard to specific edit text - android

I came to a big problem. I have my own custom keyboard. My goal is to use this keyboard in my other application.
First I tried to set this keyboard as a default device's keyboard programatically. I could do it through adb shell with no problem. But couldn't make it from app using Runtime.exec(). Unfortunately the device is not rooted.
I can use this keyboard when i enable it in settings and then set it as default input method, but I have to do it manually.
So now I would like to set this keyboard to all EditText's in my other application. Is this possible ? Thanks for any help.

Is this possible ?
No. The user gets to choose the input method editor, not you.

Related

How to open Android Keyboard in Speaking mode programmatically?

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.

App with own soft keyboard by default

I'm creating a app and want him to have his own custom soft keyboard by default, but I don't know how do this.
So far I have the app and a separate app for the keyboard, I tried to set the custom keyboard by default but don't managed to do that, the only way I found for enable him is via shell and enabling manually in the phone configuration, the shell command that I use:
ime enable package/appName
ime set package/appName
I tried to execute this commands via:
Runtime.getRuntime().exec();
Tried to put in the init files too, tried to substitute the default android keyboard, but nothing works.
If anyone can help me you have my thanks.

Disable speech to text button (Micro phone) on soft input keyboard in android programmatically

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"

Display emoji panel with genymotion - keyboard/touch input?

I try with no luck to open the panel with emoji icons but cannot find if it is even possible on genymotion (?) Normally the input is from keyboard.
Regards
press alt in your real keyboard, you can see the option in Language and Input.
Go to Settings->Language and Input->Current Keyboard
Turn on the "Show Input Method" switch.
This will cause a keyboard to appear on the screen when you input text, just like the way android works on a device that doesn't have a hardware keyboard. You can use it to input emoji.
If there's a better way, or another way, I don't know about it.

can one prevent the Android device emulator from popping up the onscreen keyboard?

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.

Categories

Resources