Android InputTypes and Keyboards

When reading input from an Android user with an EditText, you have a simple way to help that user out by setting the InputType.  If you need the user to input a number, for example, you set the number InputType, and the user will automatically key a numeric keypad instead of the full QWERTY.  This saves the user a little bit of time and mental energy, and helps avoid mistakes with input.

Beyond just text and numbers, though, are a range of options that produce very subtle changes in the keyboard that Android brings up.  Below I explore which options bring up which keypad by default.

Screenshot_2015-04-10-12-04-55First, the standard keyboard, which covers a lot of the input types.
TYPE_CLASS_TEXT
TYPE_TEXT_VARIATION_EMAIL_SUBJECT
TYPE_TEXT_VARIATION_LONG_MESSAGE
TYPE_TEXT_VARIATION_PERSON_NAME
TYPE_TEXT_VARIATION_POSTAL_ADDRESS
TYPE_TEXT_VARIATION_PASSWORD
TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
TYPE_TEXT_VARIATION_WEB_EDIT_TEXT
TYPE_TEXT_VARIATION_FILTER
TYPE_TEXT_VARIATION_PHONETIC
TYPE_TEXT_VARIATION_WEB_PASSWORD

Screenshot_2015-04-10-12-05-02For our first subtle variation, the URI keyboard replaces the comma with a slash.
TYPE_TEXT_VARIATION_URI

Screenshot_2015-04-10-12-05-07Next, the email keyboard replaces the comma with an @.
TYPE_TEXT_VARIATION_EMAIL_ADDRESS
TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS

Screenshot_2015-04-10-12-05-23The short message keyboard replaces the enter key with emoji access.
TYPE_TEXT_VARIATION_SHORT_MESSAGE

Screenshot_2015-04-10-12-06-22The other main keyboard is for numeric entry.
TYPE_CLASS_NUMBER
TYPE_NUMBER_FLAG_DECIMAL
TYPE_NUMBER_FLAG_SIGNED

Screenshot_2015-04-10-12-06-40The number password variant reduces the available symbols and focuses just on the numbers.
TYPE_NUMBER_VARIATION_PASSWORD

Screenshot_2015-04-10-12-06-56The phone class adds some symbols common for phone number formatting, plus star & hash.
TYPE_CLASS_PHONE

Screenshot_2015-04-10-12-07-17The date/time class gives you a slash and colon for formatting.
TYPE_CLASS_DATETIME

Screenshot_2015-04-10-12-07-23The date variant only allows for a slash.
TYPE_DATETIME_VARIATION_DATE

Screenshot_2015-04-10-12-07-29The time variant only allows a colon.
TYPE_DATETIME_VARIATION_TIME

Author: jeb

Views expressed here are my own and do not necessarily reflect the views of my employer.