Stop keyboard from popping in a Cordova app - android

I have an app that, in a specific view uses a custom numeric keypad. The problem is the native keyboard keeps popping in the inputs on that view. How can I prevent that? I changed the inputs to read-only, and it seems to work, but without the cursor there is no way the user will know where he is editing. My app is initially an android-only app.
I need to use the native keyboard in other views, like the login view, as the password isn't numeric only.
Is there a way to prevent the native keyboard to open in a specific view? Or if I need to leave the readonly format, how can I "mask" the css to help the user?
I have a variable that is responsible for changing the ng-model attr value.
I thought of editing the css in the $watch of that variable, but how can I do that?
Thanks in advance!

This may help you.
Put this inside the Activities where you don't want the keyboard to be displayed.
<activity android:windowSoftInputMode="stateHidden" ...>

You can't prevent keyboard show as I know, but you can simulate the behaviour.
Use ionic keyboard plugin, and when the field is focused, just do cordova.plugins.Keyboard.close();

Related

Is there anyway using html5 to force android/ios virtual keyboard to be shown

I have some html forms that when they get rendered I would like the keyboard to appear without the user having to touch the field first. I have tried using click and focus neither brings up the keyboard.
For what its worth I am using angular.
I do not believe this is possible with out a very kludgy work around. You might be able to have a hidden text field that it set to focus, which would bring up the keyboard and then manually set focus on other items in the view when needed. However this might cause some issues and you might be able to see the cursor in the hidden text field, among other issues. Why do you need the keyboard to be displayed without a focus on some field?

android soft keyboard modifications

Is there a way to programmatically remove certain keys from the standard software keyboard. By setting some of the input type flags I am so close to having the keyboard I need. From the calling application is there a way to modify the keyboard directly. I know how to make my own custom keyboard but it seems such a waste to remove one button from the standard one.
////// edit///////
I think I found a way around this if any one has tried this method please let me know if it worked for you.
I have going to grab the softKeyboard service and using the start hook the keyboard uses to grab its view object inflate my own and swap them.
From my research there is no way to implement your own custom keyboard from within a single application. If you want to have a custom keyboard you need to create one from scratch and can not use the IME
soft keyboard comes for edit text. you can modify the softkeyboard for that edit text.
For that you need to set inputType and imeOption property of that edit text.

Text Input on android phone is not in view when the keyboard for webview comes up?

I have a webview on an android phone that is a registration form and it contains some fields such as first name, last name, user name, password, etc... When focus on the first name input field for example, the keyboard pops up, but the input goes out of view, it still has focus though. Is there a way to keep it in view or is this a bug?
This seems to be a problem common to Android applications. The application does not scroll the view such that the input field under focus is visible when the soft keyboard appears. There might be a solution, but it is something you'd have to implement and not a bug (per se).
I found this answer here :
https://stackoverflow.com/a/5097539/1498996
Add this to your activity tag in the AndroidManifest.xml:
<activity android:windowSoftInputMode="adjustNothing"
//other flags
/>
It worked for me.

android add buttons on top of softkeyboard

I want to add some buttons on top of the soft keyboard (Enter and Cancel). Is there a nice way to do this or do I have to detect the keyboard being shown and add the buttons into my view?
I can't see the logic your trying to apply here.
if you add buttons above your keyboard then you lose some areas in your keyboard (for example you cant press on q w s a).
I think you should look into creating your own custom keyboard.
maybe this will help
android app specific soft keyboard
Jason
You won't be able to do this, and with good reason. If apps could modify an existing input method like this, they could trivially log all keystrokes on your device without you knowing. If you've ever installed a custom input method, you'll see a big warning that using it means trusting it not to log your keystrokes, and the functionality you're after would totally circumvent that protection.

android app specific soft keyboard

Is there a way to create an app specific soft keyboard on Android? After reading about InputMethodService docs and checking out alternative keyboard apps out there, I figure the alternate keyboard can only be configured for system wide usage (through Settings -> Locale and Text).
If the answer to above question is no, then is there at least a way to load a custom dictionary and override the default dictionary of the system keyboard (only when my app is in use)? That will help in giving very relevant suggestions to the user when he has only tapped couple of keys.
If you just want a View that looks and acts like a soft keyboard, I did that in my SmallKeyboard class. You just need to extend android.inputmethodservice.KeyboardView and decide on layout. See the onKey and onText methods at the end of that file for the action taken when keys are pressed.
Instead of my keyboard model inner class, you could load it from XML if your key set is fairly constant.
The Android Nethack application has a complete and clear source code example of how to create a custom keyboard for an application, how to display it on screen and how to define multiple keyboard layouts. It contains pretty much everything you need to know.
It is by far the best example I have seen.
http://code.google.com/p/nethack-android/

Categories

Resources