|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.nokia.mid.network.NetworkState
public final class NetworkState
NetworkState provides network setting, state retrieving and change notification to client which implements NetworkStateListener interface
Copyright (c) 2012 Nokia Mobile Phones
Code Snippet 1:
// This is a sample code to get the nework state of the sim card in second slot
NetworkState.getState(1);
Code Snippet 2:
// This is a sample code to subscribe network state change event
try{
NetworkState.subscribeListener(this);
} catch (Exception e) {
}
Code Snippet 3:
// This is a sample code to implement a NetworkStateListener in a class which implements this interface
public void networkStateChanged(int simIndex, int state) {
form.append("recevie network state on sim slot " + simIndex + " state is " + state);
}
| Field Summary | |
|---|---|
static int |
NETWORK_STATE_HOME
Constant for network state (Home, in home network). |
static int |
NETWORK_STATE_NO_NETWORK
Constant for network state (No Network, no network). |
static int |
NETWORK_STATE_ROAMING
Constant for network state (Roaming, in roaming network). |
| Method Summary | |
|---|---|
static int |
getState(int simIndex)
get network state for one sim card. |
static void |
subscribeListener(NetworkStateListener listener)
Subscribe network state listener. |
static void |
unSubscribeListener(NetworkStateListener listener)
unSubscribe network state listener. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NETWORK_STATE_HOME
Constant for network state (Home, in home network).
NETWORK_STATE_HOME has the value 0x01.
public static final int NETWORK_STATE_ROAMING
Constant for network state (Roaming, in roaming network).
NETWORK_STATE_ROAMING has the value 0x02.
public static final int NETWORK_STATE_NO_NETWORK
Constant for network state (No Network, no network).
NETWORK_STATE_NONETWORK has the value 0x03.
| Method Detail |
|---|
public static void subscribeListener(NetworkStateListener listener)
listener - the object that will receive the network state event.public static void unSubscribeListener(NetworkStateListener listener)
listener - the object that is receiving the network state event.
public static int getState(int simIndex)
throws java.lang.IllegalArgumentException
simIndex - the index of sim card which state is queried. 0 for sim card in first slot and 1 for sim card in second slot
java.lang.IllegalArgumentException - If simIndex is not valid.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||