swetha kini
swetha kini

Reputation: 564

Is it better to plot android Graph using JAR or OpenGL

I am trying to plot a real time graph with close to 2000 points,plotting one point at a time.This works well with both JARs(achartengine,android plot) and OPENGL, but graph plotting is very slow.Please suggest techniques to increase the plotting speed.

Upvotes: 0

Views: 706

Answers (2)

escalator
escalator

Reputation: 889

What do you mean by "slow"? Low fps rate? Which rate do you want to achieve?

If you actually want a higher rendering speed, you have only one serious choice: programming in OpenGL.

Upvotes: 0

the-ginger-geek
the-ginger-geek

Reputation: 7081

Address your platform you want to use

This speed issue can weigh in on both ends.

The library (jar as you call it) approach will be faster to draw initially because I assume they draw on canvas. We use this approach to draw some complex charts on our app. This way is simple and straight forward. The charts are mostly static with some features for interaction.

The OpenGL approach will take longer to render initially because it needs to first load the GLView and start up OpenGL before the chart can draw and this can sometimes be time consuming but as soon as this is loaded it will be way faster to perform draw operations and fancy features than the jar approach.

In the end it comes down to what you want to do. If you only want to plot a chart and update it with the latest data I wouldn't use OpenGL but if you want to add cool zoom features and panning ect you can most definitely use OpenGl to perform these operations.

You are limited by libraries

The thing about libraries are you can only improve the way you implement them, for example check for unnecessary for loops, make sure you aren't calling any unnecessary methods on the chart ect. (cannot really help you improve without showing some code)

We weren't prepared to be dependent on a piece of source code that will only be updated periodically because this can cause bugs to stay in your system for a long time. So we wrote our own charting classes. It's really simple and if your chart is only designed to plot the newest points in your x and y axis this is a better, lightweight approach that you have complete control over. Sure it's a lot more work than using a existing library but in the end you are in control.

hope this gives you some idea on what to look at

Upvotes: 1

Related Questions