Code example for PathMeasure

0
		age = 0;
		this.maxAge = maxAge;
		 
		// Build a path for the particle to travel 
		path = buildPath(startX, startY, maxBox);
		pathMeasure = new PathMeasure(path, false);
		 
		// Create the interpolators 
		positionInterpolator = new DecelerateInterpolator();
		opacityInterpolator = new AccelerateDecelerateInterpolator();
		 
		// Build the paint 
		paint = new Paint();
		paint.setColor(Color.parseColor("#ff4540"));
	} 
	 
	/*** Drawing ***/ 
	 
	public void draw(Canvas canvas) {
		// Switch to a new matrix 
		Matrix oldMatrix = canvas.getMatrix();