com.nokia.mid.network
Class SIMState

java.lang.Object
  extended by com.nokia.mid.network.SIMState

public final class SIMState
extends java.lang.Object

SIMState provides SIM change notification to client which implements SIMStateListener interface.

Copyright (c) 2012 Nokia Mobile Phones

Code Snippet 1:
 // This is a sample code to get the state of the sim card in first slot

     SIMState.getState(0);

 

Code Snippet 2:

 // This is a sample code to subscribe state change event of sim card

     try{
             SIMState.subscribeListener(this);
         } catch (Exception e) {
         }

 

Code Snippet 3:

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

 public void SIMStateChanged(int simIndex, int state) {
     form.append("recevie sim card state on slot " + simIndex + " state is " + state);
 }
 


Field Summary
static int SIM_STATE_NO_SIM
          Constant for SIM cannot be found from phone.
static int SIM_STATE_NOT_READY
          Constant for SIM can be found from phone but it is not ready.
static int SIM_STATE_READY
          Constant for SIM can be found from phone and it is ready.
 
Method Summary
static int getState(int simIndex)
          get sim state.
static void subscribeListener(SIMStateListener listener)
          Subscribe SIM state listener.
static void unSubscribeListener(SIMStateListener listener)
          unSubscribe SIM state listener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIM_STATE_READY

public static final int SIM_STATE_READY

Constant for SIM can be found from phone and it is ready.

SIM_STATE_READY has the value 0x01.

See Also:
Constant Field Values

SIM_STATE_NOT_READY

public static final int SIM_STATE_NOT_READY

Constant for SIM can be found from phone but it is not ready.

SIM_STATE_NOTREADY has the value 0x02.

See Also:
Constant Field Values

SIM_STATE_NO_SIM

public static final int SIM_STATE_NO_SIM

Constant for SIM cannot be found from phone.

SIM_STATE_NOSIM has the value 0x03.

See Also:
Constant Field Values
Method Detail

subscribeListener

public static void subscribeListener(SIMStateListener listener)
Subscribe SIM state listener.

Parameters:
listener - the object that will receive the SIM state event.

unSubscribeListener

public static void unSubscribeListener(SIMStateListener listener)
unSubscribe SIM state listener.

Parameters:
listener - the object that is receiving the SIM state event.

getState

public static int getState(int simIndex)
                    throws java.lang.IllegalArgumentException
get sim state.

Parameters:
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
Throws:
java.lang.IllegalArgumentException - If simIndex is not valid.


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.