I noticed that among other attributes, that we can specify for EditText
as an inputType
, there are two, that look similar:
Google doc has explained very less about this.
We can understand that textWebEmailAddress
is something related to HTML or WebView
, but I would like to know what exactly, the difference between the two is.
The android:inputType attribute allows you to specify various behaviors for the input method. Most importantly, if your text field is intended for basic text input (such as for a text message), you should enable auto spelling correction with the "textAutoCorrect" value.
textPhonetic. Text that is for phonetic pronunciation, such as a phonetic name field in a contact entry. Corresponds to TYPE_CLASS_TEXT / TYPE_TEXT_VARIATION_PHONETIC . textWebEmailAddress. Text that will be used as an e-mail address on a web form.
TYPE_NUMBER_FLAG_SIGNED. Flag of TYPE_CLASS_NUMBER : the number is signed, allowing a positive or negative sign at the start.
Here are some resources I've found regarding these two inputType
s:
... For example, textEmailAddress is a text field where the user will enter something that is an e-mail address ([email protected]) so the key layout will have an '@' character in easy access...
This was found here.
And then:
...You can specify the type of keyboard you want for your EditText object with the android:inputType attribute. For example, if you want the user to input an email address, you should use the textEmailAddress input type...
This was found here.
And the only thing I can find on textWebEmailAddress
is:
Variation of TYPE_CLASS_TEXT: entering e-mail address inside of a web form. This was added in HONEYCOMB. An IME must target this API version or later to see this input type; if it doesn't, a request for this type will be seen as TYPE_TEXT_VARIATION_EMAIL_ADDRESS when passed through EditorInfo.makeCompatible(int).
This was found here.
From what I've seen in these sections, there is very little difference in the results, the keyboards are the same, just specified differently for different locations of inputs; one in a web form, one for general-purpose.
Also the textWebEmailAddress
is only effective for Honeycomb and newer platforms, while the regular is compatible for all. Although both could be used in older versions, per the documentation, they would operationally be a regular textEmailAddress
anyways.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With