How to enable both hardware and virtual keyboards on Android ice cream sandwich
Asked Answered
S

7

30

I'm developping a stock management application with Django for a customer's company, and want to use an ice cream sandwich tablet as the end-user device. I use an USB barcode reader which works fine.

My problem is that once the barcode reader is plugged in, it's recognized as a real keyboard, and I can't access the virtual keyboard anymore. This is a big issue for me, because I only use the barcode reader to encode EAN13 codes, and need the soft keyboard beside...

Is there any way to enable both virtual and real keyboards ? I really need help on this....

Thank you !

Schaab answered 12/5, 2012 at 7:3 Comment(4)
Saving for use later, I will have to solve the exact same problem some time down the road :)Derr
Hi.. Do you get any solution for this issue.. I too need to enter barcodes manually and from barcode scanner too.. But my android version 4.2.2 not permits me to open the on screen keyboard when barcode scanner is connected.Ginoginsberg
@kumarSudheer have you already find a way ?? I have exact the same problem, have an android device with a physical input device and while the physical device is plugged the softkeyboard is always hiddenSapor
just check this answer, it might be the one you are looking forOsei
S
18

Well, I found a solution to my problem ! (Don't know what to about the bounty now...)

When you enter a text area (eg : on the navigator), you just have to touch the keyboard icon on the left of the clock. There beside "Use physical keyboard", you have to choose "No".

I found that even like that, the barcode reader will still be active (yessss !) and the soft keyboard will popup too !

Schaab answered 14/5, 2012 at 9:34 Comment(4)
is this possible in a single screen where two edittext are there, and i want to show soft keyboard on one edittext and hide on another. because on focus on second edittext, want to scan barcode.Quintie
Just to clarify for Lollipop on tablet: Install some 3rd party keyboard. Swiping down from the top will allow you to go directly to language and input settings. Choose the keyboard you want (does not have to be the 3rd party one), now the soft keyboard should show even though a physical keyboard is attached.Derr
On a tablet (Polaroid) with v4.1.1 this option doesn't work :( THIS works: System Settings, Language & input, Default (under Keyboard & Input Methods), toggle Hardware Physical Keyboard Off. The setting doesn't stick on restarts or HW disconnect/reconnectReminisce
This works!! However, can we programmatically switch it to "No"?Rosyrot
B
15

Yes, the barcode scanner is detected as a Physical Keyboard. 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 scanner/keyboard is connected and redirect the user to the Input Method selection window, by overriding the onConfigurationChanged method like this:

@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();
  }
}
Bahner answered 18/6, 2014 at 14:7 Comment(5)
here is my solution (no in onConfiguration... but in onResume and onFocus) https://mcmap.net/q/500260/-show-soft-keyboard-even-though-a-hardware-keyboard-is-connectedArbe
onConfigurationChanged event is given in the Application class. This way, we can detect scanner plugged in anywhere in the app.Bahner
aaRBiyecH, this not work in common case if scanner already (always) pluggedArbe
Once you connect the scanner, you have to turn off hardware keyboard from settings. You can use both soft keyboard and scanner till you remove and conenct the scannerBahner
correct. Im talking just about the call point for check/ask function.Arbe
T
11

You could use InputMethodManager to force the software keyboard open:

InputMethodManager imm = (InputMethodManager)getContext().getSystemService(
                                              Context.INPUT_METHOD_SERVICE); 
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
Tetragrammaton answered 14/5, 2012 at 7:46 Comment(8)
Hi and thank you for this answer, but i'm not developing my application on Android, but on Django, on an external server. What I need is to tweak the Android configuration to do this...Schaab
Do you access it via the browser then?Tetragrammaton
Yes Stuart that's what I do. Btw, I feel stupid now that I found the solution... Really thought that this option was disabling the material keyboardSchaab
Glad to hear you found a solution :)Tetragrammaton
Just so others don't get confused: this will not necessarily solve the problem if a physical keyboard is involved.Derr
The problem remains if a physical keyboard is present. like a barcode scanner. This is not the answer.Complainant
The problem remains if a physical keyboard is present. like a barcode scanner. This is not the answer.Complainant
This is not the answer to the questionSapor
F
5

Try this to force to open soft keyboard:

((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);

To close back the soft keyboard:

((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(_pay_box_helper.getWindowToken(), 0);
Farrel answered 20/5, 2012 at 2:35 Comment(2)
Thank you Maverick, this would be a great answer if I was developing an android app, but as I said earlier, I'm only using the tablet to access the django application via a browser. Btw I found the solution by myself.Schaab
Above code is not working when an external keyboard is attached already.Sincerity
S
2

I am not a programmer but have the same issues all here have posted. After much digging around online, I found a keyboard thru the Google Play store that seems to work great for us (BT Scanner & want SoftKeyboard at the same time). It's called Hacker's Keyboard by Klaus Weidner.

Just use Hackers Keyboard, go to Setting--> scroll down to "Language & Input" --> Hacker's Keyboard --> go to --> Configurations --> Scroll down to "INPUT MODE SETTINGS" --> Make sure "Show Soft Keyboard Always" is checked. The Softkeyboard will stay up even if the scanner is connected via bluetooth. Works as well when disconnecting and reconnecting the Bluetooth scanner.

Seer answered 17/6, 2015 at 4:22 Comment(0)
N
1

Doesn't work with the stock keyboard as the icon does not show. You need either another keyboard app installed or a keyboard switcher app (even if you don't install any other keyboard, it will just show the icon)

Nedrud answered 26/2, 2013 at 3:54 Comment(0)
S
0

It worked for me after I enabled Use on-screen keyboard (Keep it on screen while physical keyboard is active) in Languages & input > Keyboard, mouse, and track pad.

Sergeant answered 17/11, 2021 at 15:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.