×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Jan 2010
    Location
    Bangalore
    Posts
    11

    setting the backlight ON for specified duration

    can anyone tell me how to have the the backlight turned ON for specified duration...

    ex: In my App, when an image is viewed, the backlight goes off in sometime. is there any way to increase the time in my Application.??

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: setting the backlight ON for specified duration

    Quote Originally Posted by divya10688 View Post
    can anyone tell me how to have the the backlight turned ON for specified duration...

    ex: In my App, when an image is viewed, the backlight goes off in sometime. is there any way to increase the time in my Application.??
    For Nokia and SE devices try NokiaUI.

    com.nokia.mid.ui.DeviceControl.setLights(0,100);

    setLights

    public static void setLights(int num,
    int level)
    Activates and deactivates the lights on the device. Parameter num indicates the number of the device light to control. Currently only one num parameter value is specified: num value 0 is used for controlling the screen backlight. Parameter level is a value between 0-100, which indicates the brightness of the light. In many implementations, there are only two levels: on or off. Value 0 indicates lights off for monochrome displays or the minimum brightness setting for color displays. All other level values (1-100) are used for turning the lights on, possibly with different brightness levels, depending on the value. A larger value always results in either the same brightness setting as a lower one, or a brighter setting. For many products, values 1-100 will just turn the lights on.
    Note: Since in some devices key presses may turn on some device lights, the light settings may be changed also by the system.

    Parameters:
    num - is the number or id for light, 0 is used for display backlight, other numbers are currently left unspecified.
    level - the lighting level 0-100. 0 means "off" or some other minimum lighting setting. For many devices, a value greater than 0 means "light on".
    Throws:
    java.lang.IllegalArgumentException - if light num is not supported or level is not between 0-100.
    Since:
    1.0
    Thanks,
    Ekta

  3. #3
    Registered User
    Join Date
    Jan 2010
    Location
    Bangalore
    Posts
    11

    Re: setting the backlight ON for specified duration

    Quote Originally Posted by ektasrv View Post
    For Nokia and SE devices try NokiaUI.

    com.nokia.mid.ui.DeviceControl.setLights(0,100);

    setLights

    public static void setLights(int num,
    int level)
    Activates and deactivates the lights on the device. Parameter num indicates the number of the device light to control. Currently only one num parameter value is specified: num value 0 is used for controlling the screen backlight. Parameter level is a value between 0-100, which indicates the brightness of the light. In many implementations, there are only two levels: on or off. Value 0 indicates lights off for monochrome displays or the minimum brightness setting for color displays. All other level values (1-100) are used for turning the lights on, possibly with different brightness levels, depending on the value. A larger value always results in either the same brightness setting as a lower one, or a brighter setting. For many products, values 1-100 will just turn the lights on.
    Note: Since in some devices key presses may turn on some device lights, the light settings may be changed also by the system.

    Parameters:
    num - is the number or id for light, 0 is used for display backlight, other numbers are currently left unspecified.
    level - the lighting level 0-100. 0 means "off" or some other minimum lighting setting. For many devices, a value greater than 0 means "light on".
    Throws:
    java.lang.IllegalArgumentException - if light num is not supported or level is not between 0-100.
    Since:
    1.0
    i don want to use nokia UI .. is there any other standard.
    i am using j2me polosh for ui.

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: setting the backlight ON for specified duration

    Quote Originally Posted by divya10688 View Post
    i don want to use nokia UI .. is there any other standard.
    i am using j2me polosh for ui.
    NokiaUI is not a UI Library but just a optional package API that gives more control device display, graphics and sound.
    It works with j2me Polish.

    Just add this code to your midlet:

    com.nokia.mid.ui.DeviceControl.setLights(0,100);

    and test on device, for more info - refer to http://wiki.forum.nokia.com/index.php/Nokia_UI_API
    Thanks,
    Ekta

  5. #5
    Registered User
    Join Date
    Jan 2010
    Location
    Bangalore
    Posts
    11

    Re: setting the backlight ON for specified duration

    Quote Originally Posted by ektasrv View Post
    NokiaUI is not a UI Library but just a optional package API that gives more control device display, graphics and sound.
    It works with j2me Polish.

    Just add this code to your midlet:

    com.nokia.mid.ui.DeviceControl.setLights(0,100);

    and test on device, for more info - refer to http://wiki.forum.nokia.com/index.php/Nokia_UI_API
    this statement would not work in other phones rite.? i want the backlight to be on for any device and not contrained to Nokia or SE

  6. #6
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: setting the backlight ON for specified duration

    Refer to this: http://wiki.forum.nokia.com/index.ph...e_screen_saver

    It works on Nokia, SE as is.
    On Samsung and Motorola you have slightly different API provided by Samsung & Motorola.
    This DeviceControl API are always provided by OEM and they may differ in name's hence you need to do it with exception handling and check if the API is available on the target platform.
    Thanks,
    Ekta

  7. #7
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: setting the backlight ON for specified duration

    Quote Originally Posted by divya10688 View Post
    can anyone tell me how to have the the backlight turned ON for specified duration...

    ex: In my App, when an image is viewed, the backlight goes off in sometime. is there any way to increase the time in my Application.??
    Ya check this wiki article about the Flashing the Backlight

    Change value according to your need :
    Code:
    Display.getDisplay(this).flashBacklight(5000);
    Cheers,
    RaHuL

  8. #8
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: setting the backlight ON for specified duration

    @ Rahul - Divya is not asking about - Flashing the Backlight -

    Divya is asking a solution for keeping the backlight turned ON for long period of time when running his application on the device so that power saver / screen saver does not switch it off, and wiki article I suggest below gave the required solution.
    Thanks,
    Ekta

  9. #9
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: setting the backlight ON for specified duration

    @ ektasrv

    In my link by increasing the second she can keep the backlight ON for the seconds she has entered.
    This is discussion board , You don't decide it.

    Best regards,
    RaHuL

  10. #10
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: setting the backlight ON for specified duration

    @ rahul

    FYI As per API doc flashBacklight


    public boolean flashBacklight(int duration)
    Requests a flashing effect for the device's backlight. The flashing effect is intended to be used to attract the user's attention or as a special effect for games. Examples of flashing are cycling the backlight on and off or from dim to bright repeatedly. The return value indicates if the flashing of the backlight can be controlled by the application.
    The flashing effect occurs for the requested duration, or it is switched off if the requested duration is zero. This method returns immediately; that is, it must not block the caller while the flashing effect is running.

    Calls to this method are honored only if the Display is in the foreground. This method MUST perform no action and return false if the Display is in the background.

    The device MAY limit or override the duration. For devices that do not include a controllable backlight, calls to this method return false.

    Parameters:
    duration - the number of milliseconds the backlight should be flashed, or zero if the flashing should be stopped
    Returns:
    true if the backlight can be controlled by the application and this display is in the foreground, false otherwise
    Throws:
    IllegalArgumentException - if duration is negative
    Since:
    MIDP 2.0

    by increasing the second she can keep the backlight ON for the seconds she has entered.
    but in you it say's - This snippet demonstrates how to flash the backlight of the device for a specified duration.

    "It for Flashing not for keeping the lighs on" which Divya wanted to know in her post.
    Thanks,
    Ekta

Similar Threads

  1. S40 - Addition of Backlight Setting
    By Flying Fox in forum General Development Questions
    Replies: 7
    Last Post: 2011-06-07, 08:21
  2. getting duration value from Duration Editor
    By Vymmiatacz in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-05-04, 22:09
  3. Replies: 1
    Last Post: 2004-02-19, 13:59
  4. I want to implement a duration setting item. Can anyone help?
    By hanwang in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-07-02, 08:17
  5. JAVA library setting duration of the slide show
    By mmscpeg in forum General Messaging
    Replies: 1
    Last Post: 2002-10-07, 04:42

Posting Permissions

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