yo1122 yo1122 - 2 months ago 25
Android Question

How to "record" and "replay" touch events in android?

I'm trying to code an app that interacts with other apps, screen touches, etc'.

To get things started - all I want is a button, that once clicked it starts saving information about actions taken: screen touches, keyboard strokes, etc'. Once clicked again it stops. After this another button, once clicked, repeats the exact same actions.

How to interact in such a way? I can't find information about the code words needed, how it works, etc'.

Answer

you're looking for a command pattern

for each click you create a command and put it onto a stack and execute it. later you can 'replay' all commands if you iterate through these commands