Is there an option to have both soft and hard keyboards active? - android

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) .

Related

How to disable back button behavior?

I need to create a pin entry. I want the numeric keypad to be visible always. The problem is, I cannot override hardware button behavior which dismisses the keyboard. OnBackButtonPressed isn't entered when the button is pressed for dismissing the keyboard. What can I do? ()
I think that the best option for you is use an specific keyboard.
Maybe you can use this Xamarin component https://components.xamarin.com/view/TestComponent

AS3 Air for Android programatically show soft keyboard

Is there a way in AS3 Air for Android to show the soft keyboard programatically?
I have a project where when the user clicks a button, it pops up a form for them to enter their email address. I have it set to programatically focus on the "TextInput", but unfortunately this doesn't automatically bring up the keyboard. So the user has to tap the "TextInput" field again to bring up the keyboard.
Is there a way to just call a "show keyboard" function? I tried adding:
email_txt.needsSoftKeyboard = true;
But that doesn't seem to help.
Thanks!
Figured it out. I just had to call requestSoftKeyboard(); on the TextInput component.
email_txt.requestSoftKeyboard();
Not sure why that was so hard to search for the answer.

How do i assert if soft keyboard is invoked when we tap on edit text

I wanted to know if there is a way in which we can assert if the soft keyboard is launched when we tap on edittext using robotium
See correct answer for the question How do I Detect if Software Keyboard is Visible on Android Device?
Also you could use setInputType(0) method to make sure that the keyboard will not be shown while you enter text with robotium.....
solo.getEditText(index).setInputType(0);

Removing navigation buttons from android soft keyboard?

I would like to remove the navigation buttons at the bottom of the soft keyboard ( the buttons with the arrow- they act like a tab key to move between fields). I have had no luck trying to find a way to do this. Does anyone have any suggestions
What you're describing is device-specific, as each device has its own default soft keyboard. Unfortunately, you'll need to make a custom keyboard.
Look at the Keyboard class.
I don't believe it's possible to remove the button from the keyboard, but you can at least specify which neighbor the field gives focus to. See Handling UI Events on the Android Dev Guide.
Perhaps it's possible to set nextFocusDown to nothing, so the keyboard doesn't let the user navigate in that fashion. If that doesn't work, you might consider setting the field that takes focus next to setFocusable(false).

Detect if phone's keyboard is slid out

I'd like to set focus to an EditText and automatically bring up the virtual keyboard in certain situations. However, if a phone's hardware keyboard is slid out, I wouldn't want to. Is there any way to detect whether or not a phone's hardware keyboard (if one exists) is slid out? Or is there some functionality of the EditText that will handle all this for me?
if (getResources().getConfiguration().hardKeyboardHidden==Configuration.HARDKEYBOARDHIDDEN_NO)
{
//do stuff
}
To dive deeper, triggering OnConfigurationChanged on keyboard slide is explained in Activity restart on rotation Android

Categories

Resources