The most complete answer is this:
- The Android 2.x default browser does not natively support SVG.
- The Android 3+ default browsers DO support SVG.
To add SVG support to 2.x versions of the platform, you have two basic choices:
- Install a more capable browser (like Firefox or Opera Mobile - both support SVG)
- Use a JavaScript polyfill that can parse SVG and render it to an HTML5 canvas
The first option is okay if you're just trying to make SVG work for personal uses or a limited (controllable) set of users. It's not a great option if you want to use SVG while targeting a large, uncontrolled user base.
In the later case, you want to use a polyfill. There are many JavaScript libraries available today that can prase SVG and render to a canvas. Two examples are:
Using a polyfill, you can render your SVG in a canavs on all versions of Android 2.x.
For a more complete example of this approach, you can refer to this blog post that discusses the use of the canvg polyfill for making Kendo UI DataViz charts (SVG-based) work on Android 2.x. Hope that helps!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…