Can i use d3.js for creating interactive visualizations inside an android app?

user2760 picture user2760 · May 14, 2012 · Viewed 17.8k times · Source

I am trying to create an interactive visualization within an android app.

The data that will be visualized will be stored locally in a sqlite database and will be queried to generate visualizations.

I have not yet decided whether to build a native app or a web app.

Based on my research d3.js seems to fit the needs very well but I am unsure about how to use it in a mobile environment.

Answer

Jay Askren picture Jay Askren · May 26, 2012

You can easily embed Javascript into an Android app using the WebView component or you can use PhoneGap or a similar platform. Unfortunately, before Android 3.0 the native android browser did not display svg and D3 is based on SVG, so it will not work in the android 2.3 (or below) browser. It does however work in the Firefox browser.

Another option would be to use InfoVis Toolkit in a WebView or in phone gap. InfoVis Toolkit seems to work better on Android.

I don't know of a comparable Android visualization platform, but D3, and it's predecessors Protovis, Flare, and Prefuse are all open source. You could try porting one of them to Android perhaps.

Here is a related question: visualization tool for mobile (tablet)