Error
I have a strange mistake in the piano application. Sometimes the keys (and thus the notes) hang. I did a lot of debugging and narrowed it down to what seems like a fuzzy android processing when handling motion events:
DEBUG/(2091): ACTION_DOWN A4
DEBUG/(2091): KeyDown: A4
DEBUG/(2091): ACTION_MOVE A4 => A4
DEBUG/(2091): ACTION_MOVE ignoring
DEBUG/(2091): ACTION_MOVE A4 => A4
DEBUG/(2091): ACTION_MOVE ignoring
DEBUG/(2091): ACTION_MOVE A4 => A4
DEBUG/(2091): ACTION_MOVE ignoring
DEBUG/(2091): ACTION_UP B4 //HOW CAN THIS BE????
DEBUG/(2091): KeyUp: B4
DEBUG/(2091): Stream is null, can't stop
DEBUG/(2091): Hanging Note: A4 X=240-287 EventX=292 Y=117-200 EventY=164
DEBUG/(2091): KeyUp Note: B4 X=288-335 EventX=292 Y=117-200 EventY=164
It is clear that here it is clear that from nowhere I unexpectedly received ACTION_UPfor another note. Shouldn't I get it first ACTION_MOVE?
As shown at the end of the log, this is definitely not an error in detecting an area, since the event is ACTION_UPclearly in area B4.
Login Information
Each onTouchEvent()call is logged, so the log is accurate.
Corresponding pseudo code for ACTION_MOVE logging:
Key oldKey = Key.get(event.getHistoricalX(), event.getHistoricalY());
Key newKey = Key.get(event.getX(), event.getY());
Question
Is this the usual behavior for Android (jumping in coordinates)?
ACTION_UP - ACTION_MOVE ?