user493244
user493244

Reputation: 919

svg files rendering in android

I wrote a program in Android for setting different kinds of images as my background image, but it is not working with svg files. I am not getting any errors, it is not displaying any image and I'm getting a blank screen in my emulator when using svg files. Can any one suggest how to read and display svg files in Android with some code? Or should I convert xml code?

Upvotes: 5

Views: 9223

Answers (3)

Asaph
Asaph

Reputation: 162791

Getting Batik to run on Android would involve a significant porting effort. There are easier ways to work with SVG on Android. See this answer and this post for details.

Batik uses Java2D to render SVG. Android does not support Java2D, and has its own custom graphics API instead. Batik likely won't work out-of-the-box on Android.

Upvotes: 5

Paul LeBeau
Paul LeBeau

Reputation: 101820

Another alternative is AndroidSVG (http://code.google.com/p/androidsvg/).

Upvotes: 0

jbeard4
jbeard4

Reputation: 12811

If you can afford to only support Android versions greater than 3, then you could use a Webkit instance to render SVG, as the Android Webkit browser finally has SVG support compiled in.

Alternatively, if you do not require support for scripting or animation, you try using this library: http://code.google.com/p/svg-android/

Upvotes: 0

Related Questions