SVG processing under Java on Android and desktop

2020-03-02 04:03发布

I am trying to write a Java application that will generate SVG image based on XML file. The application should also be able to show SVG file. My application should run on Android platform and desktop PCs. I read about Swing + Batik but afaik it will not work on Android. What is the best library to achieve this ?

标签: java android svg
3条回答
一夜七次
2楼-- · 2020-03-02 04:30

Also try this open-source library, Apache 2.0 license:

SVG-Android

Performance is good as the actual drawing is handled natively by an android.graphics.Picture object.

查看更多
▲ chillily
3楼-- · 2020-03-02 04:37

per this thread: libsvg ported

libsvg has been ported to android..see thread for details. You need a crystax form of NDK, ie exceptions enabled..build/install doc here at:build-install-doc

查看更多
趁早两清
4楼-- · 2020-03-02 04:52

This article in Code Project deals with the subject. Two approaches are presented:

  • android-libsvg library.
  • Anti Grain Geometry engine.

Both solutions have dependencies on native code library, so you would need JNI.

There is also svg4mobile project, which only uses Java.

查看更多
登录 后发表回答