Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 09:04, 24 August 2007.

TSJ000666 - Controlling screen saver in MIDlets on S60 devices

From Forum Nokia Wiki


Subject:

Controlling screen saver in MIDlets on S60 devices

TSJ000666

 

Platform(s): Device(s), SW version(s):
S60 3rd Edition, FP1  

Category:

Java

Subcategory:

Nokia UI

Description:

Description:
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.
Solution:
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:
     import com.nokia.mid.ui.DeviceControl;
     // ...
     // run() function in a Thread/Runnable
     public void run()
         {
         // ...
         while( true )
             {
             DeviceControl.setLights( 0, 100 );
             Thread.sleep( 2000 );  // 2 seconds
             }
         // ...
         }

Creation date:

June 4, 2007

Last modified:

 
Related Discussions
Thread Thread Starter Forum Replies Last Post
Passing parameters to MIDlets? clawler@zicorp.com Mobile Java General 4 2006-06-27 06:54
what is screen saver's format? Nokia_Archive Smart Messaging 4 2003-10-29 11:07
s40 api for c++ nimco Tools and SDK Feedback 1 2006-05-17 16:33
Normal midlets into Symbian nabieh General Symbian C++ 0 2003-11-23 12:15
Midlets and Symbians! nabieh General Symbian C++ 0 2004-01-06 12:55
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZKnowledgeBaseContentQ
     qfnZtypeQUqfnTypeZTechnicalSolutionQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX