androidsvgimageviewsvg-android

I get just blank white screen while using svg-android


Purpose: I want to display an SVG image file using preferably an ImageView.

Attempt 1:

Result 1:

I'm testing on samsung galaxy I93000 (International version)

All I get is a white screen.

No compilation or runtime errors.

Logcat output is as follows:

01-13 01:22:11.755: D/dalvikvm(24889): GC_FOR_ALLOC freed 52K, 7% free 12198K/12995K, paused 17ms, total 17ms
01-13 01:22:11.765: I/dalvikvm-heap(24889): Grow heap (frag case) to 17.000MB for 4642816-byte allocation
01-13 01:22:11.810: D/dalvikvm(24889): GC_CONCURRENT freed 1K, 5% free 16730K/17543K, paused 15ms+2ms, total 43ms
01-13 01:22:12.080: D/dalvikvm(24889): GC_FOR_ALLOC freed <1K, 5% free 16731K/17543K, paused 13ms, total 13ms
01-13 01:22:12.100: I/dalvikvm-heap(24889): Grow heap (frag case) to 21.928MB for 5168972-byte allocation
01-13 01:22:12.125: D/dalvikvm(24889): GC_CONCURRENT freed <1K, 4% free 21779K/22599K, paused 12ms+2ms, total 25ms
01-13 01:22:12.560: D/libEGL(24889): loaded /system/lib/egl/libEGL_mali.so
01-13 01:22:12.595: D/libEGL(24889): loaded /system/lib/egl/libGLESv1_CM_mali.so
01-13 01:22:12.600: D/libEGL(24889): loaded /system/lib/egl/libGLESv2_mali.so
01-13 01:22:12.605: D/(24889): Device driver API match
01-13 01:22:12.605: D/(24889): Device driver API version: 10
01-13 01:22:12.605: D/(24889): User space API version: 10 
01-13 01:22:12.605: D/(24889): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Tue Oct 16 15:37:13 KST 2012 
01-13 01:22:12.670: D/OpenGLRenderer(24889): Enabling debug mode 0

Update 1:

I've tried making the activity that shows SVG graphic as the main activity from the manifest. There is no change in results.

Update 2:

Trying another library/way to do this - ImageView with SVG Support. Will post back with results.

Update 3:

Just so you know, I've already taken a look at SVG support on Android. The answers there do not really provide a native solution. One workaround would be to create static html pages, one for each svg, referencing the SVG js library. This doesn't seem maintainable at all. I would be that person people curse when they look at legacy code.

As you might have guessed the above trial didn't work out quite well.


Solution

  • You've probably already found a solution, but for future reference:

    I'm testing on samsung galaxy I93000 (International version)

    All I get is a white screen.

    No compilation or runtime errors.

    You probably need to disable hardware acceleration for the ImageView that you're using:

    imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    

    I had this exact same problem with a fork of svg-android and it was solely due to hardware acceleration.