Accessibility does not read the keyboard buttons - android

I have activated the TalkBack (Accessibility). And I'm navigating for a Screen that is displayed a keyboard in order to write a number in my app.
When I swipe from the left to the right in order to hear all items available the announcement read all my UI components but never jump to the KeyBoard Buttons. So the users will ever know there is a keyboard displayed in the UI.
I have tested on iOS and the VoiceOver is reading the Keyboard properly but seems like Android have an issue.
Does anyone know if there is a way to activate the Keyboard Voice Feedback programmatically?
I'm using this code to show the keyboard.
InputMethodManager input = (InputMethodManager)
activity.getSystemService(Context.INPUT_METHOD_SERVICE);
input.showSoftInput(activity.getCurrentFocus(), InputMethodManager
.SHOW_IMPLICIT);

The keyboard is a separate app in Android. It would need to implement accessibility itself.

Related

InputMethodManager showSoftInput method

What is the purpose of the method showSoftInput in class InputMethodManager? I am new to android, and well for me the documentation is not very clear :
Explicitly request that the current input method's soft input area be shown to the user, if needed. Call this if the user interacts with your view in such a way that they have expressed they would like to start performing input into it.
From what I have understood it opens the keyboard, am I am right? Why should we use this method, doesn't touching an EditText open automatically the keyboard??
No, touching an edit text doesn't automatically open a soft keyboard. That's just the default behavior. Under the hood, when you touch the edit text a series of events occurs. Eventually the Android framework will call showSoftInput on the IMS of the keyboard. This is the keyboard's chance to decide it doesn't want to show for some reason and return false if it is not shown. For example, I believe at Swype we overrode this not to show the keyboard if there was a hardware keyboard on the device already slid out, on the theory they then wanted to use the hardware keyboard.
Most of the time you're just going to either use the default implementation here, or do a few minor checks then fall back to the default implementation.

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

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

How to toggle "Use Physical Keyboard".

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.

Android onscreen keyboard without any other keyboard

I've looked at several questions and come across several posts, but i'm not able to figure out how to do this.
The following picture shows you the basic layout :
I've created a custom numpad and put it up on the repo.
Currently, when the app opens, the edit text has the focus but and anything i enter with the keyboard will go into the edittext box. This part of the functionality works fine.
Problem: When i touch the edittext again, system Input Method with its huge keyboard pops up. How do i completely block it from popping up? Or, can i tell the app to use only my keyboard instead of the system one? (Or is the only way to write a custom ime?)
i cannot use NULL type input at the manifest because doing that makes the caret in the edittext disappear and moreover if there are two edit texts, i wouldnt know which has focus.
Any help would be highly appreciated!
You can do a few things:
Programmatically hide it in the whole app:
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Hide it from the view it would be attached to:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(yourEditText.getWindowToken(), 0);
Set the input type of the EditText to 0:
EditText yourEditText=(EditText)findViewById(R.id.editTextConvertValue);
yourEditText.setInputType(0);

Galaxy Nexus' Edit Text not full screen in landscape consistently

In my application, I have a search button which when clicked will make an EditText widget visible, put focus in it, and show the keyboard. When I do this I call this code:
queryTextView.requestFocus();
InputMethodManager imm = Utilities.getInputMethodManagerFromContext(getContext());
imm.showSoftInput(queryTextView, InputMethodManager.SHOW_FORCED);
The first time this shows as I expect it to in landscape:
Once I enter text and hit search, I will hide my EditText and force the keyboard closed. I do this using this code:
InputMethodManager imm = Utilities.getInputMethodManagerFromContext(getContext());
imm.hideSoftInputFromWindow(getWindowToken(), 0);
If I were to hit my button again to make the EdidText visible and show the keyboard again, my screen looks like this (only when using the stock Galaxy Nexus keyboard):
Using another keyboard, such as SwiftKey, I do not get this behavior. What kinds of things can I look for to find out why this soft-keyboard is not filling the screen fully?
EDIT: on second thought, from your screenshots it looks like the keyboard is trying to take up the full screen, so onEvaluateFullscreenMode should be returning true...perhaps the problem is somewhere in onCreateExtractTextView
Not what you're looking for, but if all else fails perhaps you could grap the AOSP keyboard source, walk through it and figure out if/why onEvaluateFullscreenMode is returning, or maybe it isn't being called at all.
Use android:imeOptions="flagNoFullscreen" to achieve that feature.

Categories

Resources