×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    76

    Question Problem while building 40 series application

    Hi,
    I'm using Wireless Toolkit for building 40 series application (where i've change the settings of MIDP to 1.0 and others left as it is).In which i'm using SDKs of "S40_SDK_3rd_Edition" as i wanna use Nokia UI API.
    This application compile fine but while preverifying it is giving an error that
    "Error preverifying class java.lang.String

    ERROR: floating-point arguments should not appear
    com.sun.kvem.ktools.ExecutionException: Preverifier returned 1"

    Can anyone resolve this problem ?
    or Any suggestions while building 40 series build.

    Sachin Warang.

  2. #2
    Regular Contributor
    Join Date
    Mar 2005
    Posts
    249

    Re: Problem while building 40 series application

    which CLDC are you using? CLDC 1.0 does not support floating point arguments/values.

  3. #3
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    76

    Question Re: Problem while building 40 series application

    Hi,
    Thanks Friend!This solution resolved the problem but after running the application and selecting the application for vibration it is throwing application error as "java/lang/IllegalStateException" ,
    i'm using "Series 40 SDK 3rd Edition" emulater. I'm building application to vibrate it on 40 series using Nokia UI API's.where i've used Nokia UI API like "DeviceControl.startVibra(100, 2000);" and "DeviceControl.flashLights(2000);"

    Can anyone resolved this issue?

    Sachin Warang.

  4. #4
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: Problem while building 40 series application

    For vibration try using javax.microedition.lcdui.Display.vibrate(int duration) this works fine for me.

    Regards
    Gopal

  5. #5
    Regular Contributor
    Join Date
    Mar 2005
    Posts
    249

    Re: Problem while building 40 series application

    Read the Nokia API documentation to find out why the exception was thrown. Some methods will list down common exceptions and reasons why they were thrown.

    eg.
    getKeyCode
    Throws:
    IllegalArgumentException - if gameAction is not a valid game action
    You should catch these exceptions, and handle them gracefully.

  6. #6
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    76

    Question Re: Problem while building 40 series application

    Hi Gopal,
    But in 40 series MIDP 1.0 doesn't support vibration so "javax.microedition.lcdui.Display.vibrate(int duration)" will not work here.
    I've read the documentation of "Nokia_UI_API_Programmers_Guide_v1_1_en" where they specify in Vibration controls that the application will throw an "java/lang/IllegalStateException" if device doesn't support vibration even if the device is a model that normally supports vibration, it won’t support vibration if, for instance, it is plugged into a desktop stand. The user may plug the device into the stand while your MIDlet is running, so you should always address this possible
    exception.
    (I'm not abel to get what they exactly want to say.)
    Is there any solution?
    Is there API to identify that device support vibration or not?
    Can i get the list of devices in 40 series which supports vibration?

    Regards,
    Sachin Warang.

  7. #7
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: Problem while building 40 series application

    Quote Originally Posted by sachinwarang
    But in 40 series MIDP 1.0 doesn't support vibration so "javax.microedition.lcdui.Display.vibrate(int duration)" will not work here.
    Since you were talking about Series 40 SDK 3rd Edition and AFAIK all devices in Series 40 SDK 3rd Edition are MIDP 2.0

    Regards
    Gopal

  8. #8
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    76

    Question Re: Problem while building 40 series application

    Thanks Gopal,
    Problem remains as it is? As the documentation of "Nokia_UI_API_Programmers_Guide_v1_1_en" where they specify in Vibration controls that the application will throw an "java/lang/IllegalStateException" if device doesn't support vibration even if the device is a model that normally supports vibration, it won’t support vibration if, for instance, it is plugged into a desktop stand. The user may plug the device into the stand while your MIDlet is running, so you should always address this possible
    exception.
    (I'm not abel to get what they exactly want to say.)
    Is there any solution?
    Is there API to identify that device support vibration or not?
    Can i get the list of devices in 40 series which supports vibration?

    or Should i used some other 40 series SDK?

    Sachin Warang.

  9. #9
    Regular Contributor
    Join Date
    Mar 2005
    Posts
    249

    Re: Problem while building 40 series application

    So are you targeting MIDP 2.0 devices only or all s40 devices regardless of MIDP1.0/2.0? As Gopal mentioned, all S40 DP3 are MIDP2.0 devices. But if you are targeting ALL S40 devices, then you have to worry about MIDP1.0.

    As Gopal has mentioned, there are only 2 ways to vibrate the phone - Nokia UI & MIDP 2.0.
    In MIDP 2.0, the return boolean of vibrate(..) will tell you whether your vibration was successful. And as you so succintly put, the DeviceContol.startVibra(...) will throw and IllegalStateException if it's not supported/or cannot be executed at the moment in time.

    So my simple suggestion is this: Use the Nokia UI. If an IllegalStateException is thrown, and if you are using MIDP 2.0, then try to use the vibrate() method. If nothing works, too bad. Nothing you can do so flash the lights instead.

    Imho, you shouldn't be worrying about how the SDK reacts, but instead how the actual phones react. It's more important to handle the situations and try-catch cases properly than worry about why the SDK won't vibrate.

  10. #10
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    76

    Question Re: Problem while building 40 series application

    Hi,
    Can anyone give me the list of 40 series devices (having MIDP 1.0 ) in which using Nokia UI API i'm abel to vibrate.I've try on following devices,
    Nokia 6170,Nokia 7210,Nokia 6610.
    But in all this devices they throw Illegal state exception while enabling the vibration using Nokia UI API.
    And also in Nokia 6630(60 series) where i've try using both the ways (Standard API and Nokia API).I know its good to stick standard j2me api in 60 series .but still i wanna know why in this build also it is throwing IllegalStateException while enabling the vibration using Nokia UI APIs?

    Sachin Warang.

Similar Threads

  1. Replies: 21
    Last Post: 2007-09-05, 16:09
  2. Problem with Series 90 application icon
    By ManishPatil in forum Symbian
    Replies: 3
    Last Post: 2005-07-21, 11:49
  3. Replies: 0
    Last Post: 2004-10-31, 13:13
  4. Replies: 1
    Last Post: 2003-04-01, 11:37
  5. problem running j2me application on Nokia Emulator 60 series
    By chancp in forum Mobile Java General
    Replies: 0
    Last Post: 2002-07-03, 02:55

Posting Permissions

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