com.nokia.mid.setting
Class Setting

java.lang.Object
  extended by com.nokia.mid.setting.Setting

public final class Setting
extends java.lang.Object

Setting provides phone settings retrieving and change notification to client which implements SettingListener

Copyright (c) 2012 Nokia Mobile Phones

Code Snippet 1:
 // This is a sample code to get the state of flight mode

     Setting.getSetting(Setting.SETTING_FLIGHT_MODE);

 

Code Snippet 2:

 // This is a sample code to subscribe/unsubscribe setting change notification

    Setting.subscribeListener(this);

    Setting.unSubscribeListener(this);

 

Code Snippet 3:

 // This is a sample code to implement a SettingListener in a class which implements this interface

 public void settingChanged(int setting, int value) {
     form.append("recevie change notification. Setting is " + setting + " value is " + value);
 }
 


Field Summary
static int ACCEPT
          Constant for dataconnection, roamingdataconnection setting.
static int ASK
          Constant for dataconnection, roamingdataconnection setting.
static int DENY
          Constant for dataconnection, roamingdataconnection setting.
static int INVALID
          Constant for invalid setting value.
static int OFF
          Constant for flight mode, vibrator, silence setting OFF.
static int ON
          Constant for flight mode, vibrator, silence setting ON.
static int SETTING_BACKGROUND_DATA_CONNECTION
          Constant for background data connection.
static int SETTING_DATA_CONNECTION
          Constant for data connection behavior.
static int SETTING_FLIGHT_MODE
          Constant for flight mode setting.
static int SETTING_ROAMING_DATA_CONNECTION
          Constant for roaming data connection behavior.
static int SETTING_SILENT
          Constant for silence.
static int SETTING_VIBRATOR
          Constant for vibrator.
static int WIFIONLY
          Constant for background dataconnection
 
Method Summary
static int getSetting(int index)
          retreive phone setting.
static void subscribeListener(SettingListener listener)
          Subscribe phone setting change listener.
static void unSubscribeListener(SettingListener listener)
          unSubscribe phone setting change listener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SETTING_FLIGHT_MODE

public static final int SETTING_FLIGHT_MODE

Constant for flight mode setting.

SETTING_FLIGHTMODE has the value 0x01.

See Also:
Constant Field Values

SETTING_DATA_CONNECTION

public static final int SETTING_DATA_CONNECTION

Constant for data connection behavior.

SETTING_DATACONNECTION has the value 0x02.

See Also:
Constant Field Values

SETTING_ROAMING_DATA_CONNECTION

public static final int SETTING_ROAMING_DATA_CONNECTION

Constant for roaming data connection behavior.

SETTING_ROAMINGDATACONNECTION has the value 0x03.

See Also:
Constant Field Values

SETTING_VIBRATOR

public static final int SETTING_VIBRATOR

Constant for vibrator.

SETTING_VIBRATOR has the value 0x04.

See Also:
Constant Field Values

SETTING_SILENT

public static final int SETTING_SILENT

Constant for silence.

SETTING_SILENCE has the value 0x05.

See Also:
Constant Field Values

SETTING_BACKGROUND_DATA_CONNECTION

public static final int SETTING_BACKGROUND_DATA_CONNECTION

Constant for background data connection.

SETTING_BACKGROUND_DATA_CONNECTION has the value 0x06.

See Also:
Constant Field Values

INVALID

public static final int INVALID

Constant for invalid setting value.

INVALID has the value 0x00.

See Also:
Constant Field Values

ON

public static final int ON

Constant for flight mode, vibrator, silence setting ON.

ON has the value 0x01.

See Also:
Constant Field Values

OFF

public static final int OFF

Constant for flight mode, vibrator, silence setting OFF.

OFF has the value 0x02.

See Also:
Constant Field Values

DENY

public static final int DENY

Constant for dataconnection, roamingdataconnection setting.

DENY has the value 0x03.

See Also:
Constant Field Values

ASK

public static final int ASK

Constant for dataconnection, roamingdataconnection setting.

ASK has the value 0x04.

See Also:
Constant Field Values

ACCEPT

public static final int ACCEPT

Constant for dataconnection, roamingdataconnection setting.

ACCEPT has the value 0x05.

See Also:
Constant Field Values

WIFIONLY

public static final int WIFIONLY

Constant for background dataconnection

WIFIONLY has the value 0x06.

See Also:
Constant Field Values
Method Detail

subscribeListener

public static void subscribeListener(SettingListener listener)
Subscribe phone setting change listener.

Parameters:
listener - the object that will receive the phone setting change event.

unSubscribeListener

public static void unSubscribeListener(SettingListener listener)
unSubscribe phone setting change listener.

Parameters:
listener - the object that is receiving the phone setting change event.

getSetting

public static int getSetting(int index)
retreive phone setting.

Parameters:
index - the index of the setting.