Android - How to control / map / dispatch a pointer InputDevice Events?
<p>My Android device has pointer device (as like as mouse), and it shows the mouse pointer icon on screen.</p>

<p>I want to be able to control this device with Android's API but I don't know how.
In Android's shell used 'getevent' command to check the pointer device
The result was somthing like:</p>

<pre><code>...
/dev/input/event3: 0002 0000 0000000c
/dev/input/event3: 0002 0001 0000000b
...
</code></pre>

<p>so it means i use de device <code>/device/input/event3</code> with code <code>0002</code></p>

<p>My aproach was getting the input device:</p>

<pre><code>InputDevice id = InputDevice.getDevice(InputDevice.SOURCE_CLASS_POINTER );
</code></pre>

<p>and then control the motion event with <a href="http://developer.android.com/reference/android/view/MotionEvent.html#setLocation%28float,%20float%29" rel="nofollow"><code>MotionEvent.setLocation</code></a></p>

<p>I want to simulate the motion events, and click events!
This will run in a Android's service.</p>

<p>In short, I want to create a new custom Event (MotionEvent) (eg. move to X and Y) , and apply it!</p>

<p>I checked out that <a href="http://developer.android.com/reference/android/app/Instrumentation.html" rel="nofollow">Instrumentation</a> class supports event control but it is used for testing purposes only.</p>

<p>Can anyone help me?! Any suggestion?</p>
