Code example for MotionEvent.PointerCoords

0
			 
			@Override 
			public boolean onTouch(View view, MotionEvent event) {
				// TODO Auto-generated method stub 
				int action = event.getAction();
				PointerCoords curCoord = new PointerCoords();
				event.getPointerCoords(0, curCoord);
				Calendar calendar = Calendar.getInstance();
				long curTime = calendar.getTimeInMillis();
				switch(action) {
				case MotionEvent.ACTION_DOWN:
					xTouchDown = event.getAxisValue(MotionEvent.AXIS_X);// curCoord.x;
					yTouchDown = curCoord.y;
					timeTouchDown = curTime;
					cntDataPoint = 0;
					break; 
//				case MotionEvent.ACTION_MOVE: 
					default: 
					int dt = (int) (curTime - timeTouchDown);
					if(dt < HANDEDNESSTIMEOUT) {
						Log.d(LOGTAG, "[" + cntDataPoint++ + "] " + dt + ": " + event.getOrientation(0) + ", " + (event.getAxisValue(MotionEvent.AXIS_X) - xTouchDown));