title: Android drawing an animated line
body: <p>I'm currently working with graphics and paths, and I can successufully display whatever I want.</p>
  
  <p>But instead of drawing a line directly on my SurfaceView, I'd like to draw it progressively in an animation.</p>
  
  <p>What I've done so far is to create a Path and then to use PathMeasure to retrieve the coordinates progressively along the path. Here is basically what I've done so far</p>
  
  <pre><code>PathMeasure pm = new PathMeasure(myPath, false);
  
      float position = 0;
      float end = pm.getLength();
      float[] coord = {0,0,0,0,0,0,0,0,0};
  
      while (position &lt; end){
          Matrix m = new Matrix();
          // put the current path position coordinates into the matrix
          pm.getMatrix(position, m, PathMeasure.POSITION_MATRIX_FLAG | PathMeasure.TANGENT_MATRIX_FLAG);
          // put the matrix data into the coord array (coord[2] = x and coord[5] = y)
          m.getValues(coord);
          ????
          position += 1;
  
      }
  </code></pre>
  
  <p>The question marks is where I'm stuck. I want to draw the path progressively and see it animated on the screen. I couldn't find much info about it on the internet, so any clue would be much appreciated if you have already come across the same situation. The final effect I want to create is like a pencil drawing progressively a text automatically.</p>