Very interesting question!
Perhaps you will try to create two partially transparent Activity -s, showing your own copy of the same xml layout, and then switching the "z-order" of the active Activity depending on the movement.
Activity A will be “your own” activity, and it will have a transparent upper half, and RelativeLayout lower half. It would also have a normal screen orientation, for example: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) .
Activity In will be "your opponents activity." It will also have a transparent top half and a copy of the same RelativeLayout as the bottom. However, it would have an inverted screen orientation, for example: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT) . This would mean that the transparent part of Activity B would overlap the part of RelativeLayout Activity A, and the transparent part of Activity A would overlap the part of RelativeLayout Activity B.
You can also put the corresponding Activity -s startup mode on the “one top” or some other suitable value, so you don’t create a new instance of your Activity when you “start it again”, i.e. pass "make-a-move-ticket" to the adversary.
Unfortunately, the orientation ...REVERSE_PORTRAIT not added up to API level 9 (Android 2.3.something), and you are explicitly requesting API level 8.
The optimal part of this approach will be that, since only one action can have focus (and, therefore, take input data) at a time, you automatically get a statemachine for user input: the opponent would not have the opportunity to interact with his board, until you have made your move, and vice versa.
Hope this gives you at least a few ideas.
Hooray!
dbm
source share