Disabling Android "autocorrect" for specific field - android

I'm working on an Android app and at the front there's a login page. The Android keyboard often interrupts the users input and corrects their username to something else. It's possible for the user to just persevere and input their username but it can take a few tries. Is there a way to stop the keyboard from automatically correcting the user's input whilst entering text into that specific field?

You can try the following:
EditText etUsername = ............;
etUsername.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
To do this in xml, add this to your EditText:
android:inputType="textNoSuggestions"

android:inputType="textVisiblePassword" works for me for this problem. This will take away any suggestion from the android keypad when typing.

Related

Digit keyboard by default but allowing alphabetic characters

I have an EditText box and I want the default keyboard that comes up when it is selected to be the numeric keypad. However, I do want to allow users to enter alphabetic characters too. The solutions android:inputType="number" , et.setRawInputType(InputType.TYPE_CLASS_NUMBER)...etc does not work for me because restricts input to numeric digits only. Does someone know some solution??
Add the following line of code, and it will do the trick :)
editText.setRawInputType(Configuration.KEYBOARD_QWERTY);
This will show the the numeric keypad first, but also allows you to enter free text.
More information tap here
This problem is similar to the this.

How to set keyboard in password-type mode on start of the Activity?

I'm using the android:windowSoftInputMode="stateVisible" command for drawing keyboard at the beginning of the Activity and it works just as I want it to work with 2 slight problems - swype-typing is enabled and so is the word prediction and I want to prevent it from happening. I thought maybe setting keyboard in passwordText input mode may solve the problem but I cannot find anywhere how to do it. Is there any method that will allow me to show keyboard in passwordText mode on start of the Activity?
Also I should add that I'm looking for the way of doing that in such a way, that the keybord won't show when app is ran on device with physical keyboard (that's why I used XML declaration in the first place).
Add the following to your Edittext in xml:
android:inputType="textPassword|textNoSuggestions"
or in code:
edittext.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS|InputType.TYPE_TEXT_VARIATION_PASSWORD);
Well, for the first question, AFAIK you set the textfield to password mode, not the keyboard, like this:
<EditText
android:id="#+id/password"
android:hint="#string/password_hint"
android:inputType="textPassword"
... />
More info here: https://developer.android.com/training/keyboard-input/style.html
Now, about preventing the keyboard from appearing on a device with physical keyboard, I recomend you check this answer:
How do I prevent the software keyboard from popping up?

lock android keyboard to only show numerics

I have an android app that uses an EditText with android:inputType="number"
when the edittext first displays the softkeyboard appears with only numerics enabled (you can still see the other keys though.
The EditText also has android:digits="0123456789\n" as I want the users to be able to enter multiple lines
As soon as I hit the ENTER key to create another line the numeric keys disappear.
How can I...
a). Only show a numeric keyboard (with Enter key) e.g. just 0123456789?
b). Stop the softkeyboard showing all the other keys?
You want a multiline EditText and numeric keyboard? Seems possible, but deprecated. Check out this answer.
Update:
If everything fails, try to enforce the numeric type every time a line break is inserted:
editText.setInputType(InputType.TYPE_CLASS_NUMBER);
Found a solution
by employing
android:digits="0123456789\n"
android:inputType="phone|textMultiLine"
I obtain the desired effect.
Try this
editTextField.setRawInputType(Configuration.KEYBOARD_QWERTY);
This shows the normal key pad with the numeric version first, yet allows you to switch between them.
getInput.setRawInputType(Configuration.KEYBOARD_12KEY);

text entered in EditText does not change into password immediately

the password when entered by user does not change into * immedietly and plain text is displayed for 5 secs or so.I don't want this as my making a custom lock screen otherwise others can see the password entered.
I'm using
android:password="true"
kindly help
As far as I know this is how it is on all mobile platforms, and it's the "normal" way, because of the small, virtual keyboard you may introduce the wrong character. Nevertheless if you really want to modify that you'll have to create you own EditText, which will extend android's EditText.

edittext not showing the typed text in android

In my android application i am using a simple login page.
The issue is that when testing in android htc wildfire,the user could not see the text typed till he press back or done
I would like the user to view his text while typing itself.
'
Could anyone please let me know how to resolve this?
Please share your valuable suggestions.
Thanks in advance :)
Looks like your problem is this:
When user clicks in the EditText to type, the keyboard pops up and hides the EditText, thus the user can't see what he's typing
For this, you can put that EditText into a ScrollView so that when keyboard pops-up, Android scrolls the EditText up. This way,the user can see what he's typing.
Well I don't know whether it will help you or not. but am sharing because some other may be benifited. I got the same issue in my Kindle tablet.
And I have solved this just by adding the simple attribute to the edittext.
<EditText
.........
android:textCursorDrawable="#drawable/Black"
/>
And its done. Now it will show each character you types.
If it helps you, I will suggest you to write the above attribute everytime you declare an edittext, even though this issue doesn't occur.

Categories

Resources