×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    53

    Backlight fix - need to build platform jars?

    I've been able to code, build and deploy a jar file to Nokia and certain SonyEricsson handsets which have runtime support for the Nokia UI API and which allow me to defeat backlight timeout.

    However, there is one thing which is still not 100% clear to me.

    I can only test my app which includes this fix on the Nokia S60 FP2 emulator which comes with the S60 3rdEd/FP2 SDK. If I want to test my app using the WTK emulators (eg, DefaultColorPhone) the only workaround I've found so far is to use Netbeans customized project configurations as described in :

    http://www.netbeans.org/kb/articles/...tation-40.html

    This way I can temporarily preprocess out the calls to
    DeviceControl.setLights() to allow me to test the app using the more convenient (and faster) emulators such as DefaultColorPhone.

    Am I missing something here ? What I am trying to avoid is the need to mess about with preprocessing hacks within my code/build/deploy cycle.

    --Ian

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Backlight fix - need to build platform jars?

    Hi Ian,

    this should do the work for you (if you use CLDC 1.1), and speed up your development cycle:
    Code:
    try
    {
    	com.nokia.mid.ui.DeviceControl.setLights(0, 100);
    }
    catch(java.lang.NoClassDefFoundError e)
    {
    }
    Hope it helps,
    Pit

  3. #3
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    53

    Re: Backlight fix - need to build platform jars?

    That seemed to work very well Jappit with one other slight
    addition:

    I needed to also catch
    java.lang.ClassNotFoundException

    I was able to build the midlet using this (previously I had
    a very similar try/catch which caught generic java.lang.Exception
    which was sloppy of me).

    --Ian

  4. #4
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    53

    Re: Backlight fix - need to build platform jars?

    Correction ... sorry...

    I've just checked and it build fine when using the S60 as the configured emulator platform but it failed with the following compile/build error when using the Sun WTK 2.5.2

    C:\ProjectsMIDP\demo\src\com\itm\app\BacklightManager.java:10: package com.nokia.mid.ui does not exist
    com.nokia.mid.ui.DeviceControl.setLights(0,100);

    Is there some way to get nokiaui.jar into the build path without having to choose the Nokia S60 3rd Ed Emulator.
    I am going to have to either comment out the call above when doing fast turnaround testing (using WTK emulator) or else use the approach of custom configs in Netbeans to emulate preprocessor directives to ensure that this build error doesn't get in the way while I'm doing emulator based debugging of the app...

    --Ian

  5. #5
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    53

    Re: Backlight fix - need to build platform jars?

    A question for Jappit.

    Many thanks for your help so far.
    However, can you clarify if you use Netbeans (5.5 or 6.x) and that you can debug midlets which incorporate the setLights() method using the Sun WTK emulator(s) rather than the Nokia S60 emulator.

    In my case (even using the code you sent me) I cannot launch the WTK emulator whenever that code is present within my source code since the Netbeans project rebuilds and I get a build error because nokiaui.jar is not in the build path.
    I find the Nokia S60 3rdEd FP2 SDK bundled emulator to be much to slow for normal debug cycles.

    --Ian

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Backlight fix - need to build platform jars?

    Hi Ian,

    sorry for the delay of my reply, but since I currently use Eclipse for mobile development (launching WTK emulator from Eclipse the above code works well), I could not take a look at your specific issue up to now. Anyway, I'll try to test it on NetBeans as soon as possible and let you know (but if anyone has already an answer he's welcome )

    Pit

  7. #7
    Regular Contributor
    Join Date
    Jul 2007
    Posts
    53

    Re: Backlight fix - need to build platform jars?

    I've found a solution to my backlight fix build/deploy/debug issue on Netbeans 6.x... at least for running the app in the emulator.

    Instead of using Run from the toolbar or menu option "Run" from the right click menu on the Netbeans midp project there is another menu option "Run with.." which does a quick run allowing the developer to quickly choose the emulator he/she needs to run the app with. I need to look closely to see if Debug has an equivalent option. What I am trying to avoid is a rebuild occurring which will fail on account of the nokiaui.jar not being in the build path.

    --Ian

Similar Threads

  1. S80 SDK Fix Mystery
    By puti in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2005-11-16, 13:33
  2. Can not build for ARMI (VS 2003)
    By Ray Adams in forum Symbian Tools & SDKs
    Replies: 6
    Last Post: 2005-08-25, 04:56
  3. Replies: 1
    Last Post: 2005-07-18, 08:23
  4. help help. can't run in WINSB platform
    By khinsen in forum Symbian Tools & SDKs
    Replies: 6
    Last Post: 2005-01-03, 17:58
  5. Replies: 1
    Last Post: 2002-10-10, 03:19

Posting Permissions

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