I have an android code which starts vibrating for a random amount of time when the user touch a screen. Now I want to change it a bit. I want to ask the user to touch a predefined position, for example in the middle of screen. what should I do that only in some special coordinates touching become effective?
Share
You can use a onTouchListener. The Listener gets a MotionEvent from which you can get th coordinates and check the position:
To get the width and height you can use the following code: