Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6187211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:01:18+00:00 2026-05-24T02:01:18+00:00

Background I’m writing a graphing library for an android application (yes yes, I know

  • 0

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

  • Use View.onDraw(Canvas)
  • Use high resolution Bitmap
  • Use OpenGL

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 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:01:19+00:00Added an answer on May 24, 2026 at 2:01 am

    The problem with using Views is that you inherit from the overhead of the UI toolkit itself. While the toolkit is pretty well optimized, what it does it not necessarily what you want. The biggest drawback when you want to control your drawing is the invalidate/draw loop.

    You can work around this “issue” by using a SurfaceView. A SurfaceView lets you render onto a window using your own rendering thread, thus bypassing the UI toolkit’s overhead. And you can still use the Canvas 2D rendering API.

    Canvas is however using a software rendering pipeline. Your performance will mostly depend on the speed of the CPU and the bandwidth available. In practice, it’s rarely as fast as OpenGL. Android 3.0 offer a new hardware pipeline for Canvas but only when rendering through Views. You cannot at this time use the hardware pipeline to render directly onto a SurfaceView.

    I would recommend you give SurfaceView a try first. If you write your code correctly (don’t draw more than you need it, redraw only what has changed, etc.) you should be able to achieve the performance you seek. If that doesn’t work, go with OpenGL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I've wrote a small library that is able to create asp.net controls from
Background: I know, via pypi, about DOAP . Is there something similar to describe
Background: At my company we are developing a bunch applications that are using the
Background: Some time ago, I built a system for recording and categorizing application crashes
Background I am writing and using a very simple CGI-based (Perl) content management tool
Background I am writing code in VS 2010, .NET 4, C#. Also, in case
Background: I have a css and a js that is used only by the
Background I have a ror application which is continuously recording and showing on a
Background I've got an NSOutlineView that shows TrainingGroup entities. Each TrainingGroup represents a folder
BACKGROUND I am automating an PowerPoint 2007 via C# I am writing unittests using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.