Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    15

    Question Backlight, DeviceControl and UI API

    I need to keep the backlight on in an application for a series 40 where buttons are seldom pressed. I was thinking of using DeviceControl.setLights() from the Nokia UI API. I am developing with the Sun Wireless Toolkit 2.5.2, using MIDP 2.0

    From previous posts, it sounds as though the API should be included in the SDK, which I have installed, and I should add classes.zip to the classpath. But I have no classes.zip anywhere, and I can find no mention of the API in the SDK documentation. Is the API still avaialable, and if so how do I get it.

    Or is there another approach I can use to keep the light on?

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Backlight, DeviceControl and UI API

    What SDK have you downloaded?

    This API is not in the Sun WTK, you need a Nokia-specific API.

    Cheers,
    Graham.

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    15

    Re: Backlight, DeviceControl and UI API

    S40 6th Edition SDK


    --- B

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Backlight, DeviceControl and UI API

    In the lib folder?

  5. #5
    Registered User
    Join Date
    Jun 2003
    Posts
    15

    Re: Backlight, DeviceControl and UI API

    So far, I've just done the standard install of the SDK, which seems to be mainly an emulator application.

    Can you tell me *what* should I put in the lib folder?

    Thanks --- B

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Backlight, DeviceControl and UI API

    Look in the SDK's lib folder. That's where the library classes are.

  7. #7
    Registered User
    Join Date
    Jun 2003
    Posts
    15

    Unhappy Re: Backlight, DeviceControl and UI API

    The lib folder contains a bunch of .jar files. One of these is called nokiaui.jar. Sounds promising. I've copied this into the /lib folder of the WTK. No joy.

    When I compile I get the message

    package com.nokia.mid.ui does not exist.

    I thought the library was supposed to be in classes.zip, but that may have changed of course.

    ?

    --- B

  8. #8
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Backlight, DeviceControl and UI API

    No need to make copies. Add the JARs you want to the classpath when you compile.

  9. #9
    Registered User
    Join Date
    Jun 2003
    Posts
    15

    Re: Backlight, DeviceControl and UI API

    Is nokiaui.jar the correct one?

    --- B

  10. #10
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Backlight, DeviceControl and UI API

    If you're developing specifically for Nokia Series 40, I suggest you use *all* the JARs from the Nokia SDK, and none from the WTK, rather than try to mix the two.

    I don't have that SDK, but that sounds like it should be the one. Take a look inside it, you'll see what classes it contains.

    Cheers,
    Graham.

  11. #11
    Registered User
    Join Date
    Jun 2003
    Posts
    15

    Thumbs up Re: Backlight, DeviceControl and UI API

    OK, I sorted it. I'm developing for a variety of phones, so don't want to put all my eggs in the Nokia basket... Best solution for Sun wireless toolkit 2.5.2 seems to be:

    1. nokiaui.jar is the right file

    2. This should be copied not to the lib, but to the lib\ext (...j2mewtk\2.5.2\lib\ext) folder. This allows you to select the Nokia UI using a checkbox in the project - options - external APIs screen. So you can enable or disable the library for different builds. Don't select the bundle option.

    3. No need to change classpath - the toolkit handles that for you when you select the API. Tidy.

    Thanks for the help, Graham. I didn't end up doing exactly what you suggested, but you gave me some good clues on where to look --- B

  12. #12
    Registered User
    Join Date
    Jul 2009
    Posts
    12

    Re: Backlight, DeviceControl and UI API

    Dear All,

    I'm just getting familiar with the JavaME programming. Now I have the same problem! And I'm pretty desperate, because I can not compile my fairly simple class.

    I use "Product Version: Java(TM) ME Platform SDK 3.0 / Java: 1.6.0_13; Java HotSpot(TM) Client VM 11.3-b02" to build my package.

    I installed Nokia N97 SDK (v1.0) and I found the nokiaui.jar file. I added to my project as a resource (I usd Add jar/zip file), so it it could import com.nokia.mid.ui.DeviceControl and I added the necessary line to my code (DeviceControl.setLights(0, 100). And I compiled. The compiler threw an error stating there is some problem with the Sound object. So I added all the jar files as a resource and I could compile it (the package size grow up from 5 kB to 1850 kB :-( ).

    I tried to install the package and the phone (N96) threw an error like this: (Missing mandatory attributes (translated from Hungarian). I tried to remove some jar files and after removing midp20.jar it could go forward.

    After I press all the necessary phone buttons to fulfill the installation the phone threw an other error: Authorization failed (translated from Hungarian).

    What kind of authorization is needed and how could I get it? What should I add to be able to compile my simple code?

    TIA!

  13. #13
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Backlight, DeviceControl and UI API

    Don't add JARs as resources. They need to be added to the compiler's class path.

    By adding the JARs as resources, they are being copied into the application JAR (which is why your JAR increases hugely in size). You must not have Java API classes in your application's JAR. First, because they are already on the device. Second, because you're not allowed to.

    Graham.

  14. #14
    Registered User
    Join Date
    Jul 2009
    Posts
    12

    Re: Backlight, DeviceControl and UI API

    Thanx for Your answer! I set as Library & resources in File/Project Properties. The package checkbox must not set. And works!

    THX!

Similar Threads

  1. Nokia UI DeviceControl issue
    By ipxlittle in forum Mobile Java General
    Replies: 6
    Last Post: 2008-01-23, 02:06
  2. Nokia UI API
    By adem77 in forum Mobile Java General
    Replies: 2
    Last Post: 2005-06-16, 15:42
  3. Nokia 3200, 6100, 6610, 7210 Vibration and Sound Support (Nokia UI API)
    By rikard_wigforss@hotmail.com in forum Mobile Java General
    Replies: 6
    Last Post: 2004-03-19, 16:14
  4. Problems with the Nokia UI API - DeviceControl class
    By cs8st in forum Mobile Java General
    Replies: 3
    Last Post: 2003-06-12, 15:06
  5. Nokia UI API and SunONEStudio
    By rickong in forum Mobile Java General
    Replies: 1
    Last Post: 2003-02-27, 04:51

Posting Permissions

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