Does multi-tap fires events as single-tap?
Events such:
click
pressed
released
and maybe more, because it uses another finger to create variations?
Thank You.
Yes, multitouch is detected the same way as simple touch: via onTouch(). The difference is in the supplied MotionEvent. You can check which point has been changed by getPointerId(int).
For a complete example take a look at: http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2-part-3-understanding-touch-events/1775
Related
I was wondering if I could use several events on one display table, like several custom events, touch events and enterFrame events.
If so, what are the restrictions? can I trigger an event inside an event response function?
As far as I know you can use an event inside event response function but it depends on what do you want to achieve for example an enterFrame can be trigger by a touch eventListener but some eventListener will need to complete it's function in order to trigger another eventListener like targeted events or collision event.
I haven't personally used all the events and listener so a may not cover all the restriction of it but you can refer to this link to know event and listener.
I achieved that in one of my projects. I used collision and touch event together and it worked great. So I assume that you can use events togetger. And also because of event structure its possible to triger one or more events together. ( Touching and colliding in the same time ). But I dont recommend to use enterFrame event with other events, because of performance issues
I needed to send a simulated touch event when a user pressed the menu button on an android device, and I was able to use dispatchEvent within the touch event handler
http://docs.coronalabs.com/api/type/EventListener/dispatchEvent.html
Does "ROBOTIUM " support 2 finger touch? Actually i want to write a testcase in which the user taps and hold one button and clicks on another button using other finger.
is that possible?
Actually, it's not supported. You can write enhancement here:
http://code.google.com/p/robotium/issues/list
It is possible, its not easy but its possible. You will need to MotionEvent which you can dispatch as per your need.
I have to implement a two fingers tap.
For example I have a listView with multiple items, which already have a click listener for each row and touch listener. Now I have to do something if the user put two fingers on a row.
How can I do this?
Any suggestion is appreciated.
I believe just the gesture API only support single touch.
You basically have to override `onTouchEvent, and play with e.getPointerCount() and check the time between the ACTION_POINTER_DOWN and ACTION_POINTER_UP. You will probably also think about the case where the two touches actually do not come at the exact same time or leave the screen at the exact same time either.
Try this
Android multi-touch support
Or
http://www.rbgrn.net/content/367-source-code-to-multitouch-visible-test
android imageView: setting drag and pinch zoom parameters
This may help you.
Not sure what you mean by 2 fingers tap. If you mean a double tap (one finger, 2 taps) , I recommend this:
http://mobile.tutsplus.com/tutorials/android/android-gesture/
But if you are referring to 2 different fingers tapping once, would not recommend doing that a 2 finger tap because it goes against the Android design guidelines. If anything it is recommended to do a long press, which can easily be implemented overriding the onLongClick() method.
But if you really do not want to listen to me because you think I am stupid. You would essentially need to implement your own multi touch gesture. Here is one example:
http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2-part-2-building-the-touch-example/1763
FYI, please be aware of what android version you want to support.
which function is used for keeping track of all user interactions in Android?
I have used the onuserinteraction() function, but that does not include touching the mouse.
It includes clicking the mouse or any key event.
So is there any function which keeps track of touching the mouse also?
Take a look at these links:
View.OnTouchListener
Learn Android Tutorial 1.32 – Android’s OnTouchListener and MotionEvent
I hope this helps you...
I dont think android has a "mouse". U can only use onClick listeners.
Hi Here i want to solve the problem regarding multitouch in android. Is this possible to fire events of 2 buttons together if this is possible then how can i do this. please help regarding this. In my game application i want to do something after pressing two buttons together. How can i do this.
I don't think that it is possible to aggregate two events to a single one oob. But it shouldn't be to hard to determine if two buttons were pressed simultaneously by using a OnTouchListener you bind to the parent element of the two buttons.
When an event is thrown and the onTouch() method is called. You got a bunch of arguments related to the event, like what kind of event it was (Action_Down, Action_Move, Action_Up etc.). You also get the information if the action was performed by the first oder by the second finger so this should give you the option to decide whether both buttons were touched.
Here you can find a nice tutorial about multi touch support on Android.