android:inputType="number" to xml will automatically open the numeric keypad when you press EditText, but this will only allow you to enter character numbers, and if you want to enter other characters, you can try the following:
android:inputType="number" android:digits="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
source share