Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVG support on Android, current status

Does Android support SVG (natively)?

I found old answers here or on the web, but I don't understand the current situation.

Please give a reference if possibile.

like image 438
cdarwin Avatar asked Jan 24 '12 11:01

cdarwin


1 Answers

Does Android support SVG (natively)?

That depends on what you mean by "Android", "SVG", and "natively".

Android is a mobile operating system. It has multiple versions.

SVG is a standard. It has multiple versions.

"Natively" could mean anything from "I can decode SVG through some Java classes" to "the stock Android Web browser can render SVG".

I can tell you that the stock Android Web browser renders this Web page fine on Android 3.2 and Android 4.0, but fails on Android 2.3.

I can tell you that there is no SVG parser set of Java classes, and that ImageView and similar widgets have no ability to work with SVG directly. You may be able to use WebView to display some SVG, given that the stock browser seems to support it on newer Android versions, though it's conceivable that the SVG support is via some plugin that is not automatically available to WebView.

I cannot tell you what version of SVG is supported by the browser, as that does not appear to be documented. You would need to run some tests and see if it supports the particular SVG structures that you wish to use.

like image 157
CommonsWare Avatar answered Nov 03 '22 10:11

CommonsWare