×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    4

    Unhappy Cannot open SVG-File

    Hello everyone,

    I have a strange problem when trying to open svg image
    Code:
        private SVGImage img;
        private SVGAnimator animator;
        private InputStream inputLogo=null;
        private Canvas animatorCanvas;
    
        public SplashScreen() {
            
                try {
                    inputLogo = this.getClass().getResourceAsStream("/splashscreen_customizable.svg");
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
                try {
                img = (SVGImage) SVGImage.createImage(inputLogo, null);
                        } catch (IOException ex) {
                ex.printStackTrace();
            }
    When I try to run this in the S40 3rd Edition Emulator I get an Exveption:
    Using Maximum simulated domain
    java.io.IOException
    at javax.microedition.m2g.SVGImage.createImage(+95)

    When I look at the "Details" in the Emulator it says NullPointerException, however.

    What could be the problem?

    The SVGImage is located in the root of my jar

    When I debug this on Sony-Ericsson:
    My InputStream has an attribute called "handle" which is set to 0.
    On S40 3rd Edition FP 1 i the same attribute has the value of "null".
    In both cases the attribute size is read correctly.
    Last edited by tbender; 2008-02-05 at 10:30.

  2. #2
    Registered User
    Join Date
    Feb 2008
    Posts
    4

    Unhappy Re: Cannot open SVG-File

    I "love" replying to myself.

    What is the minimum SDK-Version to support JSR-226?
    As mentioned I am on S40 3rd Edition FP 1
    I thought, I read that this was the minimum requirement.
    But when I do:

    Code:
    System.out.println(System.getProperty("microedition.m2g.version"));
    System.out.println(System.getProperty("microedition.m2g.svg.baseProfile"));
    System.out.println(System.getProperty("microedition.m2g.svg.version"));
    So it seems to me, that I need a different SDK version. But which one?

  3. #3
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Cannot open SVG-File

    SVG is supported on Series 40 devices starting from 3rd Edition FP1 (well, 6280 has is too...)
    http://wiki.forum.nokia.com/index.ph..._Nokia_devices

    Are you saying that those system properties return null?
    I am not 100% sure, but I think these properties were defined to be mandatory only in MSA (JSR-248) so you cannot rely on them.

    Hartti

  4. #4
    Registered User
    Join Date
    Mar 2004
    Posts
    4

    Re: Cannot open SVG-File

    This is an old thread, but here's my two cents:

    I had a similar problem (svgImage cannot be null -exception). The culprit was in the SVG-file. It had the animation transforms in a <defs>-segment. After I relocated the transforms inside my <path>-elements' group definition it started to work.

    So... Remember to check your SVGs.

Similar Threads

  1. Trusted Application
    By damien_a in forum Mobile Java General
    Replies: 11
    Last Post: 2012-02-17, 20:49
  2. S60 theme questions
    By Nokian_Spb in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2006-08-17, 06:11
  3. Replies: 3
    Last Post: 2005-10-12, 05:26
  4. TinyLine SVG Minute Toolkit: Optimizing SVG for J2ME
    By girow in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-05-05, 18:44
  5. TinyLine SVG Minute Toolkit for J2ME: version 1.4 released
    By girow in forum Mobile Java General
    Replies: 0
    Last Post: 2003-05-05, 16:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×