Tips regarding high performance drawing in Android

Viewed 4264

Background

I'm writing a graphing library for an android application (yes yes, I know there are plenty out there but none that offer the customizability we need).

I want the graphs to zoomable and pan-able.

Problem

I want the experience to be smooth, leave a small CPU footprint.

Solutions

View.onDraw():

Benefits

  • Some what easy to implement

Drawbacks

  • Bad performance? (unless it uses OpenGL, does it?)

Bitmap:

Benefits

  • Really easy to implement
  • Great performance

Drawbacks

  • Have to use scaling which is ugly

OpenGL:

Benefits

  • Probably good performance depending on my implementation

Drawbacks

  • More work to implement

Final words

OpenGL would probably be the professional solution and would definitely offer more flexibility but it would require more work (how much is unclear).

One thing that is definitely easier in OpenGL is panning/zooming since I can just manipulate the matrix to get it right, the rest should be harder though I think.

I'm not afraid to get my hands dirty but I want to know I'm heading in the right direction before I start digging.

Have I missed any solutions? Are all my solutions sane?


Additional notes:

I can add that when a graph changes I want to animated the changes, this will perhaps be the most demanding task of all.

1 Answers
Related