Nokia Expands a feature on all Nokia mobile phones based on the standard j2's API. These features are provided to developers in the form of extended APIs, these extended APIs are the famous Nokia UI APIs.
For Nokia ui api documentation, you can find it in the docs directory of any simulator under Devices under the Nokia Developer's Suit installation directory.
The DeviceControl class is a class that controls the flickering background light of a mobile phone and the vibration of a mobile phone. It belongs to the com. nokia. mid. ui package and needs to be introduced before use. The main methods include:
1. flashLights
The method declaration for this method is as follows:
Public static void flashLights (long duration)
The function of this method is to temporarily flash the duration parameter specified by the screen background light in milliseconds.
After this method is called, the thread execution will not be blocked. If the device does not support this method, the method will automatically return. If the set time exceeds the maximum time supported by the device, the system automatically returns the value after the maximum blinking time.
When this method is returned, it is automatically returned to the status before flashing.
To end the execution of this method, you can use flashLights (0.
Parameters:
Duration: the number of milliseconds that flash. If the number is smaller than 0, IllegalArgumentException is thrown.
Example:
DeviceControl. flashlights (3000 );
The purpose of this Code is to set the background light to flash for 3 seconds.
2. setLights
The statement of this method is as follows:
Public static void setLights (int num, int level)
This method is used to set the brightness of the screen background light.
Parameters: