I have decided to work on an Android app that uses very similar technology to that of an app I have seen before. I wanted to string together multiple button presses to equat
I don't write a lot of java, so I can only give you psuedocode, but I'll point you in the right direction.
To finish this you only have about 3 things to do: 1. Collect your input data (the button taps), which you've almost done. 2. Know when it's time to process the input. 3. Process the input to the right output.
Collect your input.
At this point you want to store those presses in an array of id's, switch not necessary. After a few presses you should have array of inputs.
inputs[R.id.block1, R.id.block2, R.id.block2];
Know when it's time to process.
In your button press handler, add a countdown timer. With every button press, cancel the timer and start a new one.
Timer processTimer = new Timer().schedule(new TimerTask() {
public void run() { processInput(); }
}, 500); // Delay before processing.
processTimer.cancel();
processtimer.schedule(new TimerTask() {
public void run() { processInput(); }
}, 500);
When processInput() is called you know the user has stopped pressing buttons.
Process the Input.
Create key/value pairs for your outcomes.
map = {[R.id.block1],'A',
[R.id.block1, R.id.block2],'B',
[R.id.block1, R.id.block2, R.id.block2],'C',
etc...
}
Search it for the user's input and get your value.
That's basically all there is to it.