Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: what is the inputType for username

I have an edit text on my xml layout to allow the user to enter his username,like this:

<EditText
                android:id="@+id/etUsername"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:inputType=""
                />

which type of inputType should i use to make the user enter his username, the username contains just letters small letter and capital letter and numbers

like image 353
user user Avatar asked Jan 19 '13 00:01

user user


2 Answers

May I suggest textVisiblePassword|textNoSuggestions it gives you the normal keyboard with the option to display numbers but gets rid of the Android suggestions (they're pretty useless when typing in a username).

EDIT:

As pointed out by Hailwood, some users may like the added benefit of the suggestions provided by the Android keyboard. Upon reflection on the matter, perhaps a standard text might be more suited for this situation.

It's really a UX matter, you'll have to make a choice here.

like image 163
Jean-Philippe Roy Avatar answered Sep 22 '22 14:09

Jean-Philippe Roy


I would recommend android:inputType="textVisiblePassword|textNoSuggestions" as some IME/Android-Version combinations seem to ignore textNoSuggestions but not textVisiblePassword. If suggestions are left on some IME will auto insert spaces or other punctuation and auto-capitalize text which can screw up logins.

like image 45
Simon Avatar answered Sep 25 '22 14:09

Simon