Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Controlling screen saver in MIDlets on Symbian

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Created: User:Technical writer 2 (17 Aug 2007)
Last edited: lpvalente (12 Jul 2014)


Controlling screen saver in MIDlets on S60 devices


It is now possible to prevent screen saver appearance in MIDlets by using the DeviceControl class of Nokia UI API.
This functionality is available starting from S60 3rd Edition, Feature Pack 1 devices, although some early S60 3rd Edition, FP1 releases do not support this. Also the AT&T/Cingular-branded S60 3rd Edition devices support this functionality.


Calling the setLights() function once will delay screen saver appearance but does not disable it permanently. Thus, it is needed to call the setLights() function repeatedly, for example, in a separate thread. The delay between two calls should be smaller than the timeout of the screen saver (usually something like 15 seconds or more).

Note that calling setLights() only once will still keep the set light level until the MIDlet is closed or the function is called again with a different level. The looping is only needed if the screen saver should be disabled.

Here is a piece of code that calls the setLights() function in a loop and thus prevents the screen saver from appearing:

// ...
// run() function in a Thread/Runnable
public void run()
// ...
while( true )
DeviceControl.setLights( 0, 100 );
Thread.sleep( 2000 ); // 2 seconds
// ...
This page was last modified on 12 July 2014, at 19:11.
33 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.