Switch from physical to software keyboard.
Hi all,
I'm developing an application that will run on a tablet with Android 3.2.
I attached a physical keyboard to tablet then the software keyboard disappear.
Now I need to use the software keyboard in some activities, but I don't figure out how I can do that.
I tried different ways:
Android: show soft keyboard automatically when focus is on an EditText
http://dev.bostone.us/2009/11/04/android-show-and-hide-soft-keyboard-programmaticaly/#awp::2009/11/04/android-show-and-hide-soft-keyboard-programmaticaly/
http://plainoldstan.blogspot.com/2010/09/android-set-focus-and-show-soft.html
All these don't work if the physical keyboard is connected.
Someone know how can I achieve this goal?
Thanks
Under setting ther will be "Language & Input" >> Keyboard Setting >> "Input method selector" >> "Always show"
after you plug in the keyboard just put on the Keyboard ICON "on the bottom right of the screen" the select "USE PHYSICAL KEYBOARD" to off
Then the Soft keyboard (on screen) will appear normally until you unplug the keyboard.
In my case i use the barcode scanner instead of keyboard so I do need some softkeyboard however I use the USB hub and connect both barcode scanner and numeric keyboard.
hope this will help you.
Yes, when a keyboard is connected to the device, by default the soft keyboard is disabled. To enable it, we need to turn OFF hardware keyboard via:
Settings > Language & Input > Select Input Method
The option name may differ from device to device. We will be able to use the scanner along with the soft keyboard even though we turn it OFF.
And NO, there is no way currently to programmatically accomplish this. The most we can do is detect when a keyboard/scanner is connected and redirect the user to the Input Method selection window, by overriding the onConfigurationChanged method in your Application class:
#Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if(newConfig.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO) {
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE))
.showInputMethodPicker();
Toast.makeText(this, "Barcode Scanner detected. Please turn OFF Hardware/Physical keyboard to enable softkeyboard to function.", Toast.LENGTH_LONG).show();
}
}
Actually we can use physical keyboard and soft keyboard simultaneously, what u have to do is that after connecting your physical keyboard, focus on any edittext, then you can see a keyboard icon on bottom right of your screen, click on it , it'll show all all available soft i/p options plus a Switch titled 'Show Virtual keyboard - keep it on screen while physical keyboard is active' - just check this option
Related
I am developing a IME keyboard which will have a automobile dial pad as the input handler in android. More clearly, the dial pad turns decide which alphabet to select.if the dial pad is pointed to "a" and then click the center button of the dial pad, it selects alphabet "a".
But my question is, is there a way i can have both hardware and software keyboards active consecutively?
My need is, My dial pad soft keyboard comes up and then i need to test it by right and left arrow of the hardware keyboard.
Thanks in advance
For future users- if you're implementing your own keyboard you can override boolean onEvaluateInputViewShown in InputMethodService. This function controls if the keyboard is shown, and the default implementation is to return false if a hardware keyboard exists. Change it to return true and it will work.
I don't know a way to do it from inside of an app.
for navigation part, i found the solution.
go to settings->input -> default-> disable the hardware physical keyboard.
then if any text edit is used, the soft keyboard comes up and then we can use the physical keyboard to navigate. (only navigation) .
I am developing an application where I have RFID reader (emulates keyboard). In some activities I need a virtual keyboard as well. I have discovered that all I need is to toggle "Use Physical Keyboard". That works fine, but when I restart my tablet, this feature is set to default?
Is it possible, if I can insert a toggle somewhere in my code?
I was able to toggle the on-screen keyboard, with the following code:
InputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
inputMgr.toggleSoftInput(0, 0);
In reference, use EditText.
"EditText is a thin veneer over TextView that configures itself to be editable."
To display the on-screen keyboard, all they need do is touch in the textbox. If that box was named "Search" or something similar, I believe it would be more useful to a user than a button.
I would like to have both soft input and hard keyboard enabled in my android virtual device. I know how to have either but not BOTH.
The reason wanting for BOTH at the SAME time:
soft input: preview how the layout resizes when the screen is reduced by the keyobard
hard keyboard: obviously the quick input.
Thanks in advance.
Go to your AVD manager Tab then select the appropriate AVD then refer the "hardware menu" in that click on new button and select the keyboard support option to enable hardware keyboard.
Hope this is helpful to you.
yash.
Does anybody know how to programmatically disable the keyboard individual letter pop-up?
(This blue pop-up when you click in a letter on the virtual keyboard of the device.)
You can't do this from an application.
If the keyboard on a device is built to do this, the only option you have is to build/install/use a different keyboard that doesn't do it.
Applications are not capable of manipulating the system keyboard (except for small things like ime options, inputType etc.)
In your phone, go to Settings --> Language and Input --> Select the keyboard type that you are using. (In my case it says Samsung keyboard). Select the settings icon next to it. There is an option called "Character preview". Disable it.
I'm debugging an issue with the soft keyboard display not displaying when it should. However, I don't have a device handy for testing. The problem is that the emulator never shows the soft keyboard.
Some skins have a keyboard constantly displayed on the right, some don't, but none that I've tried so far has ever shown a keyboard on the device screen.
Is there some setting that I missed?
I found out how to do this on the Android emulator itself (Menu, "Settings" App - not the settings of the emulator outside). All you need to do is:
open settings app -> Language & Input -> Go to the "Keyboard & Input Methods -> click Default
This will bring up a Dialog in which case you can then disable the Hardware Keyboard by switching the hardware keyboard from on to off. This will disable the Hardware keyboard and enable the softkeyboard.
Here are the steps:
=> Settings
=> Language and Input
=> Default
=> Hardware Physical Keyboard
=> off to turn on the On Screen Keyboard
If you're using AVD manager add a hardware property Keyboard support and set it to false.
That should disable the shown keyboard, and show the virtual one.
Settings > Language & input > Current keyboard > Hardware Switch ON.
This option worked.
Settings > Language & input > Current keyboard > Hardware Switch ON.
It allows you to use your physical keyboard for input while at the same time showing the soft keyboard.
I just tested it on Android Lollipop and it works.
To be more precise, with Lollipop these are the steps I followed to show soft keyboard:
Settings > Language & Input;
under "Keyboard & input methods" label, select "Current Keyboard";
A Dialog named "Change Keyboard" appears, switch ON "Hardware", then select "Choose keyboards";
another Dialog appears, switch ON the "Sample Soft Keyboard". Here you get an alert about the possibility that keyboard will store everything you write, also passwords. Give OK;
Repeat above steps in order to show "Change Keyboard" Dialog again, here the new option "Sample Soft Keyboard" is available and you can select it.
NOTE: after that, you might experience problems in running you app (as I had). Simply restart the emulator.
Edit your virtual device using AVD.
Press the "show advance setting" button to show more option scroll
down to the bottom and check "Enable keyboard input" press "finish" button
at the bottom corner of your window
then start the emulator device that you just set up.
inside the emulator, go to the "Settings" -> "Language & Input"
and in the "Keyboard & Input Methods" -> "Default" then "choose
input method" is shown
and switch off "Hardware Physical Keyboard" toggle button
There is a bug in the new version of NOX app. Software keyboard doesn't work after switching to it in settings. To fix this, I installed Gboard using the Play Market.
Go to Tools > AVD Manager > Click on ▾ on the Respective Emulator and > Wipe Data and Restart, will solve the problem on New Android Studio.