title: Draw high res animations with high frame rate on Android
body: <p>I've got 30+ single bitmaps (320x240 pixels) that I would like to display one after another in full screen on Android devices resulting in an animation. Currently I implemented the animation using an ImageView and a Timer that sets the next frame and then sends a message that will apply the next frame. The resulting frame rate is very low: &lt; 2 fps.</p>
  
  <p><em>The timer:</em></p>
  
  <pre><code>animationTimer.scheduleAtFixedRate(new TimerTask() {
      @Override
      public void run() {
          Drawable frame = getNextFrame();
              if (frame != null) {
                  Message message = animationFrameHandler.obtainMessage(1, frame);
                  animationFrameHandler.sendMessage(message);
              }
          }
      }, 0, (int) (1000.0d / fps));
  </code></pre>
  
  <p><em>The handler:</em></p>
  
  <pre><code>final Handler animationFrameHandler = new Handler() {
      @Override
      public void handleMessage(Message message) {
          setImageDrawable((Drawable) message.obj);
      }
  };
  </code></pre>
  
  <p>Since I want to achieve frame rates up to 30 fps I have to make use of another mechanism and heard of <strong>Canvas.drawBitmapMesh()</strong> and <strong>OpenGL</strong>.</p>
  
  <p>If possible I would like to avoid using OpenGL.</p>
  
  <p>Thank you very sharing your experiences!</p>