×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    5

    Question NoClassDefFoundError: com.nokia.mid.impl.isa.ui.DeviceControl

    Hi all,

    Once I discovered that flashBacklight() method in a TimerTask() was not working as it was supposed to on S40/S60 platforms (flickering and dimming problems), I tried the DeviceControl.setLight(0, 100). Well, I can build the jar with no problems, but when running it on a S40/S60 emulator (or device, N95 for example), I get this exception:

    java.lang.NoClassDefFoundError: com.nokia.mid.impl.isa.ui.DeviceControl

    I'm importing com.nokia.mid.ui.DeviceControl, not com.nokia.mid.impl.isa.ui.DeviceControl. Does anybody have any clue about what I'm doing wrong?

    Thanks in advance.

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: NoClassDefFoundError: com.nokia.mid.impl.isa.ui.DeviceControl

    hard to tell without seeing the code.

    Hartti

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    5

    Re: NoClassDefFoundError: com.nokia.mid.impl.isa.ui.DeviceControl

    Hi, Hartti.

    Here it goes:

    // class A

    public static boolean isNokiaDevice() {
    try {
    if (System.getProperty("microedition.platform").startsWith("Nokia")) {
    Class.forName("com.nokia.mid.ui.DeviceControl");
    return true;
    }
    } catch (final Exception ex) {
    ex.printStackTrace();
    }
    return false;
    }

    // class B

    import com.nokia.mid.ui.DeviceControl;

    public class NokiaDisplay {

    public static void setBacklight(final int brightness) {
    if (brightness >= 0 && brightness <= 100) {
    DeviceControl.setLights(0, brightness);
    }
    }
    }


    // class C

    ...

    if (A.isNokiaDevice()) {
    NokiaDisplay.setBacklight(100);
    }

    ...

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    5

    Thumbs up Re: NoClassDefFoundError: com.nokia.mid.impl.isa.ui.DeviceControl

    I created a new Netbeans project and the same code got working this time. I'm not sure about what the problem was, but now it's misteriously solved. Thanks for all attention, folks.

    BTW: is there any cldc 1.0 version of nokiaui? If yes, where can I get it?

Posting Permissions

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