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.


Copyright © 2012 Nokia Corporation. All rights reserved.

Nokia is registered trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Oracle Corporation. Other product and company names mentioned herein may be trademarks or trade names of their respective owners. This document is confidential information of Nokia Corporation.

Disclaimer
The information in this document is provided "as is," with no warranties whatsoever, including any warranty of merchantability, fitness for any particular purpose, or any warranty otherwise arising out of any proposal, specification, or sample. Furthermore, information provided in this document is preliminary, and may be changed substantially prior to final release.

Nokia Corporation disclaims all liability, including liability for infringement of any proprietary rights, relating to this document and implementation of any information presented in this document.

Nokia Corporation retains the right to make changes to this document at any time, without notice.

License
Subject to above disclaimer, a license is hereby granted to use this documentation solely under existing Limited License Agreement and non-disclosure agreement between the companies for the agreed application development for Series 40 Nokia phones. No other licenses e.g. to any intellectual property rights are granted herein. Any use of the screen shots of this documentation, including any icons thereof, is subject to Nokia's prior written approval.