[android-developers] Re: Multitouch support in Android 2.0

2010-01-11 Thread Mirmathrax
Anyone else with a Droid have a chance to try the PointerLocation code yet? I have a buddy that just got a Nexus 1 and I will try the code on that phone tomorrow and post the results here. I hope this is not a hardware problem with the Droid, as gor now, I have had to redesign my entire input me

[android-developers] Re: Multitouch support in Android 2.0

2010-01-08 Thread Mirmathrax
OK, there is definitely a bug in here somewhere. I took the code for PointerLocation and run it on my droid with NO modifications whatsoever. When I perform the following pattern: 1) start drawing with finger 1 2) start drawing with finger 2 3) lift finger 1 4) start drawing with finger 1 again

[android-developers] Re: Multitouch support in Android 2.0

2010-01-08 Thread naya
I wonder about "Pointer ID" which is obtained using ACTION_POINTER_ID_MASK. Documentation says "Pointer ID" is not "Array Index" but "ID", and "Index" can be found with findPointerIndex("ID"). But when I examine source file("InputDevice.java"), it looks like "Array Index" instead of "ID" as quoted

[android-developers] Re: Multitouch support in Android 2.0

2010-01-07 Thread Mirmathrax
Thank you Dianne, >From the following code: if(numevents > 1) ptrId = (action & MotionEvent.ACTION_POINTER_ID_MASK) MotionEvent.ACTION_POINTER_ID_SHIFT; action = action & MotionEvent.ACTION_MASK; int ptrIndex = event.findPointerIndex(ptrId);

Re: [android-developers] Re: Multitouch support in Android 2.0

2010-01-07 Thread Dianne Hackborn
On Thu, Jan 7, 2010 at 7:37 AM, Mirmathrax wrote: > 4) Finger 1 goes back down at location X, Y > X = X2 > Y = Y2 > action = ACTION_POINTER_DOWN > ptrID = 0 > ptrIndex = 0 > numEvents = 2 > > ** Here is the first problem: The X and Y coordinates returned > are incorr

[android-developers] Re: Multitouch support in Android 2.0

2010-01-07 Thread Mirmathrax
I posted this in its own topic before I found this post and read it thouroughly. I am still having problems with Multi-touch not working as documented on the droid. Please read the post below for detail: I wanted to experiment with multi-touch, so I decided to add the controls for LunarLander to t

Re: [android-developers] Re: Multitouch support in Android 2.0

2010-01-07 Thread Dianne Hackborn
Run Pointer Location and make sure it works, and you can see the code here: http://android.git.kernel.org/?p=platform/development.git;a=blob;f=apps/Development/src/com/android/development/PointerLocation.java;h=38b4af2dcd97625e6fef2c1bddcb9362a127352e;hb=HEAD Note that ACTION_POINTER_DOWN encodes

[android-developers] Re: Multitouch support in Android 2.0

2010-01-07 Thread niko20
I can't seem to get any consistent results trying to use the multitouch on my droid. Even if i put both fingers down I don't get two pointers, If I put one down, then the other, it still says one pointer. Then if I lift the first one, and put it down again, then it says two. Multitouch API SUCKS

[android-developers] Re: Multitouch support in Android 2.0

2009-12-10 Thread Peter Kirn
Possibly worth adding -- while trying to analyze size is unwise with touchscreens as Dianne rightfully says, what some iPhone platform developers are doing is to determine pressure by analyzing the microphone input. This will work with Android, too (it's an old trick, pre-dating iPhone), especially

[android-developers] Re: Multitouch support in Android 2.0

2009-12-10 Thread Peter Kirn
Coming in on this part of the thread late, but this is incorrect -- you *can* actually test multitouch by plugging in multiple mice. ;) The MT4j framework, built in Java with the use of Processing, does just this: http://createdigitalmotion.com/2009/11/17/multitouch-buffet-quartz-composer-for-touc

Re: [android-developers] Re: Multitouch support in Android 2.0

2009-12-01 Thread Dianne Hackborn
On Tue, Dec 1, 2009 at 1:25 PM, patrick wrote: > ->for the pressure, when i use 2 fingers, the size 'detected' is > sometimes suddenly enormous. > That is exactly how the G1 and myTouch screen works -- when two fingers are down, the size is essentially seeing them as a large touch area. So plea

[android-developers] Re: Multitouch support in Android 2.0

2009-12-01 Thread patrick
->for the pressure, when i use 2 fingers, the size 'detected' is sometimes suddenly enormous. about the finger limit, do you know if it will be the same for the htc hero when it will receive the 2.1 firmware update? btw, thanks for all these answers On Dec 1, 7:49 pm, Dianne Hackborn wrote: > P

Re: [android-developers] Re: Multitouch support in Android 2.0

2009-12-01 Thread Dianne Hackborn
Pressure is extremely nebulous on touch screens. Actually, they don't really detect it at all -- they detect size, and pressure is generally related to that. I don't know what you mean by going wild, though I will admit I have never looked at the pressure data specifically for the second finger.

[android-developers] Re: Multitouch support in Android 2.0

2009-12-01 Thread patrick
Coordinates for each pointer are OK: when I do a swipe with 2 fingers, it draws 2 paralleles line. But if I do a swipe too fast, it seems that pressure value goes wild! you said that Droid driver only reports 2 points, is it intentional or is it a bug/limitation that we have to deal with? Will it

Re: [android-developers] Re: Multitouch support in Android 2.0

2009-12-01 Thread Dianne Hackborn
What are the coordinates you see? What event codes occur at this time? The Droid driver only reports a maximum of two points. Running Pointer Location on the Droid, I have only ever seen two points. On Tue, Dec 1, 2009 at 7:23 AM, patrick wrote: > I did a little test on a Motorola Droid: > I

[android-developers] Re: Multitouch support in Android 2.0

2009-12-01 Thread patrick
I did a little test on a Motorola Droid: I took the TouchPaint demo from the SDK and added some log in onTouchEvent() method. Theses logs returns event.getPointerCount() value. What i get is pretty weird: If a press with one fingern getPointerCount return mainly 1, but sometimes it reports 2! If

Re: [android-developers] Re: Multitouch support in Android 2.0

2009-11-18 Thread Dianne Hackborn
On Tue, Nov 17, 2009 at 3:19 PM, 3pei <333...@gmail.com> wrote: > Can you explain this in a more detail? > Different screens have different imperfections in reporting multitouch; by its nature you simply are not going to get perfect data, as there are intrinsic ambiguities in what is happening, a

[android-developers] Re: Multitouch support in Android 2.0

2009-11-18 Thread 3pei
On Nov 16, 9:30 pm, Dianne Hackborn wrote: > On Sun, Nov 15, 2009 at 7:21 PM, niko20 wrote: > for example on the > G1/Sapphire class screen there are interactions between the two points > reported, and if you play with Pointer Location on Droid you will see that > pressing a second finger can c

Re: [android-developers] Re: Multitouch support in Android 2.0

2009-11-17 Thread Dianne Hackborn
Sorry I probably should not have written the document that way. The event flow will be: 1. ACTION_DOWN 2. 0 or more ACTION_POINTER_DOWN / ACTION_POINTER_UP as additional fingers go down and up. 3. ACTION_UP The final up may not be for the same finger as the original down, depending on how finger

[android-developers] Re: Multitouch support in Android 2.0

2009-11-17 Thread PJ
> In fact, there isn't really a "primary" pointer. Well, the documentation for ACTION_POINTER_DOWN says that this applies to "non-primary pointers", which implies that there really *is* a "primary" pointer. So, I was just trying to explain why sometimes the pointers were generating ACTION_DOWN, a

Re: [android-developers] Re: Multitouch support in Android 2.0

2009-11-16 Thread Dianne Hackborn
On Sun, Nov 15, 2009 at 7:21 PM, niko20 wrote: > > I wish though, that the multitouch would have also been natively > suuportedk in the sense that multiple views should get touch events > also simultaneously. Very, very deliberately not supported. :) You'll need to look at the events arriving

Re: [android-developers] Re: Multitouch support in Android 2.0

2009-11-16 Thread Dianne Hackborn
On Sun, Nov 15, 2009 at 11:57 PM, PJ wrote: > However, one possibility is that PointerID=0 ceases to become a > "primary pointer" when 2+ fingers are touching the device. I don't > see that documented anywhere, but that's the only explanation I can > think of for your Motorola Droid's behavior.

[android-developers] Re: Multitouch support in Android 2.0

2009-11-16 Thread davemac
You are right about what is going on. My concern had to do with the pointer Ids and the transition back to primary from non-primary. When you have one pointer Id left on the screen, the last action will be ACTION_UP, even if the pointer Id of that last finger is non-zero. That last finger switched

[android-developers] Re: Multitouch support in Android 2.0

2009-11-16 Thread PJ
Ar, I didn't see Dianne's response (nor Niko's) when I posted my last response, because I didn't realize that there was a "page 2". Thanks, Dianne, for your explanation and for posting the examples! -- PJ On Nov 16, 1:57 am, PJ wrote: > I think I've figured it out for you, Dave.  :)  Bear

[android-developers] Re: Multitouch support in Android 2.0

2009-11-15 Thread PJ
I think I've figured it out for you, Dave. :) Bear with me. Let's look at the constants in MotionEvent: ACTION_MASK = 0x00ff ACTION_POINTER_ID_MASK = 0xff00 ACTION_POINTER_ID_SHIFT = 8 This confirms that the lowest order byte represents the action and the next byte represents the point

[android-developers] Re: Multitouch support in Android 2.0

2009-11-15 Thread niko20
I wish though, that the multitouch would have also been natively suuportedk in the sense that multiple views should get touch events also simultaneously. Right now it looks like it will only work on a per-view basis. Would have been nice that if views were attatche to a touch handler, and someone

Re: [android-developers] Re: Multitouch support in Android 2.0

2009-11-15 Thread Dianne Hackborn
This is the intended behavior. There are basically five actions you need to care about. For all of them, you can mask out ACTION_MASK to just look at the action part. These three are all you need to care about if you aren't interesting in multitouch: 1. ACTION_DOWN, the existing standard action

[android-developers] Re: Multitouch support in Android 2.0

2009-11-15 Thread davemac
I think I've got this figured out. Almost. With multi-touch support, getAction() can return a compound value representing the pointerID in the second byte and the action value in the first byte. For example, if two fingers are down, and pointerID 1 is lifted (i.e., finger 2), getAction() returns a

[android-developers] Re: Multitouch support in Android 2.0

2009-11-13 Thread Jeff
You can install Akirah Eclair SDK ROM on G1 and write multi-touch apps ;) As the name implies, it's the same ROM as in the SDK 2.0 emulator. Just checked, got MotionEvents from two fingers on G1. -- You received this message because you are subscribed to the Google Groups "Android Developers" gro

[android-developers] Re: Multitouch support in Android 2.0

2009-11-12 Thread PJ
Dianne: Hahaha, okay, thanks for saving me the trouble! Everyone: I'll do the community a huge favor and write a full-blown tutorial on how to write multi-touch apps... IF someone will just give me a Motorola Droid phone. ;) Seriously, if I had one, or any 2.0 phone that fully supports multi-tou

Re: [android-developers] Re: Multitouch support in Android 2.0

2009-11-11 Thread Dianne Hackborn
I am pretty sure the emulator will not do anything intelligent with this. :) I very much doubt its touch driver has even been changed to generate events with the new multitouch protocol. On Wed, Nov 11, 2009 at 1:27 PM, PJ wrote: > I'm seriously considering installing a special mouse driver tha

[android-developers] Re: Multitouch support in Android 2.0

2009-11-11 Thread PJ
I'm seriously considering installing a special mouse driver that allows two mice at once on the screen (they do exist), and trying to see if the emulator responds to simultaneous clicks as multi-touch. Someone please try this and let me know if it works. Or maybe I'll get around to it in a couple

[android-developers] Re: Multitouch support in Android 2.0

2009-11-10 Thread gratiancutule...@yahoo.com
On Oct 27, 6:45 pm, Dianne Hackborn wrote: > It's basically just some new APIs on MotionEvent: > > http://developer.android.com/reference/android/view/MotionEvent.html > > Hmmm >  and I'm not sure why, but in the doc all of

[android-developers] Re: Multitouch support in Android 2.0

2009-11-04 Thread Emmanuel
>From what I've heard, the G1 phone doesn't not handle real multi touch. When there are several touches, it just indicates all the X and Y coordinates, but you still don't know to which impact it is connected. For instance, you can know that there are some impacts with this coordinates: X = 5, 10

[android-developers] Re: Multitouch support in Android 2.0

2009-11-03 Thread PJ
A huge thank-you, Diane, for giving us this information. :D On Oct 27, 5:18 pm, RichardC wrote: > You missed the ";)" in my reply - sorry was not ment as a serious > response. > > On Oct 27, 10:00 pm, niko20 wrote: > > > > > Wait, if I use two mice, they both control the same pointer. There >

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread RichardC
You missed the ";)" in my reply - sorry was not ment as a serious response. On Oct 27, 10:00 pm, niko20 wrote: > Wait, if I use two mice, they both control the same pointer. There > isn't a way to have multiple pointers. At least on windows - maybe on > Linux you can do so more easily? > > -niko

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread niko20
Wait, if I use two mice, they both control the same pointer. There isn't a way to have multiple pointers. At least on windows - maybe on Linux you can do so more easily? -niko On Oct 27, 3:33 pm, RichardC wrote: > niko20 wrote: > >Now, if only there was a great trick to do multitouch on the > >

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread Jon Colverson
On Oct 27, 9:29 pm, Dianne Hackborn wrote: > On Tue, Oct 27, 2009 at 2:12 PM, Jon Colverson wrote: > > Is there a way to query the device to see if it supports multitouch? > > Not currently. > > > Is there anything would prevent me from getting this working via > > reflection without increasing

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread Dianne Hackborn
On Tue, Oct 27, 2009 at 2:12 PM, Jon Colverson wrote: > Is there a way to query the device to see if it supports multitouch? > Not currently. > Is there anything would prevent me from getting this working via > reflection without increasing minSdkVersion? Are the multitouch events > delivered

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread Dianne Hackborn
On Tue, Oct 27, 2009 at 2:02 PM, MrChaz wrote: > > Thanks for the info, > > Wouldn't this > Finger 1 up: MotionEvent ACTION_POINTER_1_UP with one pointer, whose > ID is > 1. > need to be ID of 0? Or am I mis-understanding the purpose of the UP > action? > Good point. Actually my example was no

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread Jon Colverson
This is very exciting stuff! I have a couple of questions about how multitouch support interacts with old devices and old apps: Is there a way to query the device to see if it supports multitouch? Is there anything would prevent me from getting this working via reflection without increasing minS

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread MrChaz
Thanks for the info, Wouldn't this Finger 1 up: MotionEvent ACTION_POINTER_1_UP with one pointer, whose ID is 1. need to be ID of 0? Or am I mis-understanding the purpose of the UP action? On Oct 27, 4:45 pm, Dianne Hackborn wrote: > It's basically just some new APIs on MotionEvent: > > http:/

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread RichardC
niko20 wrote: >Now, if only there was a great trick to do multitouch on the >emulator ! just use 2 mice ;) On Oct 27, 8:27 pm, CraigsRace wrote: > Does anyone know if every phone will support multi-touch (I remember > talk about the G1's hardware might not support multi-touch)? > > On Oct 28, 5

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread CraigsRace
Does anyone know if every phone will support multi-touch (I remember talk about the G1's hardware might not support multi-touch)? On Oct 28, 5:08 am, niko20 wrote: > Dianne, > > Thanks for the great info. Yep looks like you just get the count of > pointers and walk through that. > > Now, if onl

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread niko20
Dianne, Thanks for the great info. Yep looks like you just get the count of pointers and walk through that. Now, if only there was a great trick to do multitouch on the emulator ! (I should be getting an actual phone soon though) -niko On Oct 27, 11:45 am, Dianne Hackborn wrote: > It's basica

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread Raphael
On Tue, Oct 27, 2009 at 9:45 AM, Dianne Hackborn wrote: > It's basically just some new APIs on MotionEvent: > http://developer.android.com/reference/android/view/MotionEvent.html > Hmmm  and I'm not sure why, but in the doc all of those new APIs are in > gray, so they should be easy to see. :

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread Streets Of Boston
Dianne, Thank you for this explanation! On Oct 27, 12:45 pm, Dianne Hackborn wrote: > It's basically just some new APIs on MotionEvent: > > http://developer.android.com/reference/android/view/MotionEvent.html > > Hmmm >  a

[android-developers] Re: Multitouch support in Android 2.0

2009-10-27 Thread Dianne Hackborn
It's basically just some new APIs on MotionEvent: http://developer.android.com/reference/android/view/MotionEvent.html Hmmm and I'm not sure why, but in the doc all of those new APIs are in gray, so they should be easy to