Maximum Number of Touch Inputs on Android 2.2+
I know I ran across a specific mention of a maximum number of touch inputs that are theoretically recognized by Android (hardware limits not-withstanding), but have Googled and Googled with no tangible results.
Can anyone point me to an official document/spec/blog/something listing touch capabilities (max inputs specifically) of various flavors of Android (Froyo, Gingerbread, etc)?
Thanks开发者_开发百科 for the help,
Paul
I don't think there is an OS limit. I think it is dictated by Hardware.
Digging through the source, and I think I've come up with a definitive answer.
In the MotionEvent.java class released with Froyo, the number of pointers supported seems to be hard-coded in as 5. See static value declared on line 212 (with it's associated comment) and how this value is used in object instantiation on line 251.
Incidentally, this restriction appears to be lifted in the Gingerbread source, as the have moved from a pointer array with a defined size of 5, to an array that is defined by a parameter passed into the object constructor, with the MINIMUM size of the pointer array being 5. See the static value declaration on line 309 (again, with it's associated comment), and the constructor and obtain() methods on lines 352 and 358 respectively.
精彩评论