Search code examples
androidandroid-edittextgalaxy-tab

Samsung Galaxy Tab 10.1, virtual keyboard and edittext


I'm having an interesting experience with not owning a Samsung Galaxy Tab 10.1 (P7500) myself and only doing testing on the emulator.

The specific problem I'm having involves the virtual keyboard that is shipped with the tab, and edittext's using an inputtype of "date".

The difference between my emulator and the tab here is the fact that the emulator doesn't contain the virtual keyboard shipped with the tab, which is different from the regular Android keyboard. The issue has to do with entering actual dates on the tab, because the date is in the format of "XXXX-YY-ZZ" but it's not possible to type a dash "-" on the tab. All keys except for numbers are disabled. This, however, doesn't happen on the emulator and I can happily type in dates that contain both dashes and slashes (although dashes are the only extra characters I allow when verifying input).

This becomes a bit of a problem for future testing and I've come up with a few alternatives

  • Get a hold of the virtual keyboard from the tab and see if the emulator has the same behaviour so I can test this and future scenarios in a more controlled manner
  • Stop using the "date" as input type for the field while using toasts and verification to make sure the format is right
  • Buy a tab
  • Use a date picker

Has anyone else stumbled upon this kind of problem and found a solution to it, using an EditText and "date" as input type with a Galaxy Tab?


Solution

  • This, in the end, came down to stop using the "date" as input type. Instead I made use of the combination

    android:inputType="number|textPassword"
    android:digits="0123456789-"
    

    This became acceptable for both testing on the emulator and releasing on the actual tab.