Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User yzacarias's Avatar
    Join Date
    Aug 2009
    Posts
    8
    I try on a 5800 XM but it doesn't work. When I execute a middlet It throw this exception:java.lang.NumberFormatException. Do you know why? This is the info from the stack: What do you think?

    ======== J9 2.3 Standard Output (Mié Sep 02 21:22:48 2009) ========
    ======== J9 2.3 Standard Error (Mié Sep 02 21:22:48 2009) ========
    IBM J9 2.3 Symbian arm-32 (JIT enabled)
    J9VM - 20081015_24516_lEdFGV
    GC - 200810_03
    Uncaught exception!
    java.lang.Error: Exception in static initializer: java.lang.NumberFormatException:
    at java.lang.J9VMInternals.initialize(Unknown Source)
    at examples.sensor.SensorBrowser.<init>(Unknown Source)
    at java.lang.Class.newInstanceImpl(Native Method)
    at java.lang.Class.newInstance(Unknown Source)
    at com.symbian.j2me.midp.runtimeV2.Application.constructAction(Unknown Source)
    at com.symbian.j2me.midp.runtimeV2.Application.startRequest(Unknown Source)
    at com.symbian.j2me.midp.runtimeV2.Application.event(Unknown Source)
    at co

  2. #2
    Registered User bacconokia's Avatar
    Join Date
    Sep 2009
    Posts
    7
    I have the same problem when I call
    Code:
    SensorManager.findSensors(null, null)
    . But why?
    Probably an error in the jsr-256 add-on.

  3. #3
    Registered User ritchey007's Avatar
    Join Date
    Sep 2009
    Posts
    1
    Hi guys,

    It seems that I solved the problem !!!
    I had identical issue as You (java.lang.Error: Exception in static initializer: java.lang.NumberFormatException). Because I'm from Poland and my phone language was Polish, I suspected that this error is caused by parsing decimal number with invalid decimal point character (in Poland we use comma for this, ie: Pi equals 3,14). But the most popular in the world is UK format, which use point as separator (ie: 3.14). So i tried to change phone language in my Nokia 5800 (Menu -> Settings -> Phone -> Language -> Phone Language) to ENGLISH. Next I run the TestMidlet again, and it Worked !!!
    It seems, that current API version has a bug, that it assumes the point (.) as decimal separator and during parsing, if You have set phone language to one that uses for example comma (,) it generates error at parsing (NumberFormatException).

    Best Regards,
    MM

  4. #4
    Registered User yzacarias's Avatar
    Join Date
    Aug 2009
    Posts
    8
    It worked fine when I passed the phone to English.

    Thanks ritchey007 ,

  5. #5
    Registered User bacconokia's Avatar
    Join Date
    Sep 2009
    Posts
    7
    Yes, it works.

    Thank you very much.

  6. #6
    Registered User sblantipodi's Avatar
    Join Date
    Nov 2006
    Posts
    270
    Do you know if Nokia 5800 supports JSR256 with the default firmware or it
    need Java Runtime 2 to support it?
    thanks.

  7. #7
    Nokia Developer Champion traud's Avatar
    Join Date
    Mar 2003
    Posts
    3,863
    That add-on for the Mobile Sensor API (and its bug) seems to be merged into the main development branch: My factory new Nokia N86 8MP (Firmware 21, Java Runtime 1.0.5) has the same issue.
    Code:
    boolean supportsMobileSensor()
    {
    	boolean b = false;
    	try
    	{
    		Class.forName("javax.microedition.sensor.SensorManager");
    		b = true;
    	}
    	// standard case, if not supported
    	catch (ClassNotFoundException e) { b = false; }
    	// bad language setting with Nokia implementation
    	catch (Error e) { b = false; }
    	
    	return b;
    }
    The same happens for a Nokia E72 (Firmware 21, Java Runtime 1.0.5).
    Last edited by traud; 2010-01-29 at 08:37.

  8. #8
    Nokia Developer Moderator r2j7's Avatar
    Join Date
    Aug 2007
    Posts
    1,595
    Update, here is the published Known Issue in Forum Nokia Wiki:

    KIJ001586 - SensorManager does not work with non-English phone languages in S60 3rd Edition, Feature Pack 2

    Basically almost all affected devices have got this issue fixed in newer firmware, but unfortunately there is one device (Nokia N86 8MP) which is recognized not to have a firmware update with the fix and therefore Mobile Sensor API can only be used if English is set as phone language for that device.

    Regards,
    r2j7

  9. #9
    Registered User nilanchalapanigrahy's Avatar
    Join Date
    Sep 2009
    Location
    Bangalore, India
    Posts
    49
    Visit HERE For code sample and complete information on JSR 256.. Mobile Sensor API
    Regards
    Nilanchala

Similar Threads

  1. Does E60 (S60 3rd) support Mobile Sensor API (JSR 256)?
    By slowjoe in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2007-12-29, 19:46
  2. JSR 179 Mobile registration info (newbie)
    By WonderP in forum Mobile Java General
    Replies: 1
    Last Post: 2007-02-28, 00:41
  3. Mobile Podcasting - will it happen?
    By mobile monte in forum News, Announcements and Job Listings
    Replies: 0
    Last Post: 2006-09-22, 23:45
  4. JSR at all Nokia mobile
    By fthamura in forum Mobile Java General
    Replies: 0
    Last Post: 2004-01-09, 05:26
  5. Nokia Mobile VPN Client
    By marcyl in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2003-12-01, 14:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved