Tuesday, May 29, 2012

Any good graphing packages for Android?

With Android removing the Swing and AWT libraries from Java, I was wondering what solutions have been developed to display simple bar histograms, line graphs and other simple data visualizations in Android?

There is a Google specific 2D library. Are there any packages built atop it that allows for the easy creation of graphical data?

Some solutions bandied about on the web have been "just pull down a Google chart with a HTTP get" which seems like a fine workaround. However, our eventual expected application usage is in a poor connectivity situation where network usage is expensive (unlocked phones in resource poor settings).

Source: Tips4all



    Since this question was asked a few very nice open source native libraries have been created. These include:



    It looks like the creator of this question solved this problem and posted some interesting stuff about it to the Internet. I've linked to his solution along with several others that exist now.

    rapidandroid (question creator solution)
    Java Charts for Android

    Just to summarize: his solution involved using a JavaScript library (flot) built on top of jQuery. This library was then included in an HTML page which was loaded into a custom WebView. The custom WebView then read data from a custom Java class made accessible to JavaScript code via the WebView.addJavascriptInterface method. Details can be found at the above link.

    The other solutions may present a more straightforward approach.

  2. AChartEngine looks like another good Android chart library. It can be found here: http://www.achartengine.org/index.html

    It's the only one I've found that is all Java (no webview stuff), is open source, and the author isn't asking for money even if you end up using it in a pay app.

    To use Graphview in your Android app you are required to build an about page that references your usage of Graphview, and if you charge for your app you have to give a donation to the Graphview author.

    Java Charts for Android costs over $140 USD for a redistribution license so that you can use it on an app that you place on the Android Market.