I want to know the type of the mobile keypad programmatically. Is there any way to track this. If yes, Plea开发者_StackOverflowse guide me to get this issue ?
Haven't tried this, so may not work, but try and see.
According to this link, J2ME handsets with QWERTY keyboards "almost always return their corresponding ASCII/UTF8 value [as keyCode
parameter when the framework calls Canvas.keyPressed()
]". So try calling something like Canvas.getKeyName(65)
(i.e. the letter 'A').
If it throws IllegalArgumentException
you will know that 65 is not a valid keyCode
for that device, therefore it's not a QWERTY handset.
Let me know if it works!
精彩评论