One of my clients wants a code method that returns a boolean. True if the Android phone has hardware red/green call/hang up keys and false if it does not.
Sonething like this :
public void keyFeedbackFromInput(KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_DOWN
&& (event.getFlags() & KeyEvent.FLAG_VIRTUAL_HARD_KEY) != 0) {
// perform your logic here
}
}
But not in a key press event as in the code snippet above. He needs to determine this up front if a phone has physical red/green keys or virtual ones.
Is it possible and if yes can someone provide a code sample to achieve this?