1<?xml version="1.0" encoding="UTF-8"?> 2<!-- 3 Copyright 2013 The Android Open Source Project 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16--> 17<sample> 18 <name>BasicMultitouch</name> 19 <group>Input</group> 20 <package>com.example.android.basicmultitouch</package> 21 22 23 24 <!-- change minSdk if needed--> 25 <minSdk>8</minSdk> 26 27 28 <strings> 29 <intro> 30 <![CDATA[ 31This sample demonstrates the use of MotionEvent properties to keep track of individual touches 32across multiple touch events. 33\n\nTouch the screen with multiple fingers to show that the pointer id 34(also represented by a color) does not change as new touch events are received. 35 ]]> 36 </intro> 37 </strings> 38 39 <template src="base"/> 40 <common src="logger"/> 41 <metadata> 42 <status>PUBLISHED</status> 43 <categories>UI, Views, Input</categories> 44 <technologies>Android</technologies> 45 <languages>Java</languages> 46 <solutions>Mobile</solutions> 47 <level>INTERMEDIATE</level> 48 <icon>screenshots/icon-web.png</icon> 49 <screenshots> 50 <img>screenshots/intro.png</img> 51 <img>screenshots/touches.png</img> 52 </screenshots> 53 <api_refs> 54 <android>android.view.MotionEvent</android> 55 </api_refs> 56 <description> 57<![CDATA[ 58Sample demonstrates the use of [MotionEvent][1] properties to keep track of 59individual touches across multiple touch events. 60 61[1]: http://developer.android.com/reference/android/view/MotionEvent.html 62]]> 63 </description> 64 65 <intro> 66<![CDATA[ 67This is an example of keeping track of individual touches across multiple 68[MotionEvent][1]s. 69 70This sample uses a custom View (`TouchDisplayView`) that responds to 71touch events and draws a colored circle for each touch point. The view holds 72data related to a touch pointer, including its current position, pressure, 73and its past touch history. 74 75The View draws graphics based on data associated with each touch event to a 76canvas. A large circle indicates the current position of a touch, while smaller 77trailing circles represent previous positions for that touch. 78The size of the large circle is scaled depending on the pressure of the user's 79touch. 80 81[1]: http://developer.android.com/reference/android/view/MotionEvent.html 82]]> 83 </intro> 84 </metadata> 85</sample> 86