I am trying to change the android default keyboard to another soft keyboard that has already installed.
for achieving this task I tried this code,
imeManager.setInputMethod(txtSearch.getWindowToken(),
"lk.bhasha.helakuru/.SinhalaSoftKeyboard");
but the keyboard is not changing.
How do I switch the android soft keyboard to another already installed?
Thanks.
For security reasons, it's not possible to change the keyboard programmatically, unless your application is an IME.
From the documentation:
A client application can ask that the system let the user pick a new IME, but can not programmatically switch to one itself. This avoids malicious applications from switching the user to their own IME, which remains running when the user navigates away to another application. An IME, on the other hand, is allowed to programmatically switch the system to another IME, since it already has full control of user input.
Related
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 was using startLockTask() in a program but found out it could only be used for Android L. However I want my application to function in versions lower then 5.
Is there any way I can gain similar functionality?
Functionally, no. The point of screen pinning is to prevent the user from leaving your app. The user can't see or click on notifications, or use the home button to leave.
Visually, you can set the app to full screen,, and/or hide notification bar. You can also hide the soft keys on devices that don't have hardware buttons. However, people can always bring it back up.
EDIT: You can also disable the back button.
I want to make an application to automatically change my mobile keyboard according to application. My mobile default keyboard will change according to application, such as:
I want to use "Ridmik Keyboard" with Facebook or want to use "Swift keyboard" with Google play. Is it possible ?
I'm pretty sure that it's not possible. The only way you can change the keyboard is by asking the user to do so from the device's settings. Automatically changing the keyboard would be a major security hole, as a malicious keyboard could track passwords, for example.
Alternatively, you could ask the user to select a keyboard by calling startActivity(new Intent(android.provider.Settings.ACTION_INPUT_METHOD_SETTINGS));, and you can detect when a certain application is launched by sniffing into the LogCat.
If you are willing to root your device there are at least two solutions in the Google Play store that claim to do what you want: Keyboard Manager and Keyboard Master.
For non-rooted devices, there is Keyboard Manager Plus - however you should be aware that it flashes the keyboard picker on the screen as it automatically changes the keyboard. If you can live with that, that's a possible solution for you without rooting.
Caveat: I have not tried these myself. I am researching the issue and I do not have the option of rooting the device and I cannot live with the flashing. However, I've taken a pretty close look at all three of the above and they are the closest I've found to answering your question.
I want to use custom keyboard for my application, but I don't want to force the user to go into setting page to set my keyboard as the default keyboard.
What do I need to do to force my keyboard in my application?
Is there any chance to set soft keyboard as default programatically?
Fortunately, this is not possible, for obvious privacy and security reasons.
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.