What is multi-touch technology?
Multi-touch is a technology that has been used for a long time. It has supported multi-touch since the first generation of the iPhone. To understand what is multi-touch, you must first understand what is single-touch. No matter how many fingers touch the screen on the early touch screen, the system considers that only 1st fingers touch the screen to be valid, and then the fingers that touch the screen will be ignored. This is the so-called single touch, which refers to 1st fingers that touch the screen.
With Single-touch, multi-touch is easy to understand. Multi-point touch means that the system can touch the screen with multiple fingers at the same time. Data generated by the operations such as pressing and moving these fingers can be obtained through a program. Many interesting applications can be made based on the changes in the data. For example, image enlargement and reduction are typical multi-point touch applications. When two or more fingers contract inward, the image scales down according to a certain proportion. When two or more fingers expand outward, the image scales up proportionally.
Android supports multi-touch
Android SDK supports multi-point touch from 2.0, but initially only two-point touch (the screen can detect at most two-point touch), and the latest Android version supports five-point touch. Of course, most applications only need two fingers.
How to use multi-touch
Ontouchevent event Method
Motionevent. getx (INT pointerindex)
Motionevent. Gety (INT pointerindex)
Motionevent. gethistoricalx (INT pointerindex, int POS)
Motionevent. gethistoricaly (INT pointerindex, int POS)
Demo
21. multi-touch technology