21. multi-touch technology

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.