Android电话信息相关API(3)

NETWORK_TYPE_UNKNOWN 未知网络
NETWORK_TYPE_GPRS   
NETWORK_TYPE_EDGE 通用分组无线服务(2.5G)
NETWORK_TYPE_UMTS    全球移动通信系统(3G)
NETWORK_TYPE_HSDPA 
NETWORK_TYPE_HSUPA
NETWORK_TYPE_HSPA
NETWORK_TYPE_CDMA         CDMA网络(2.1版本)
NETWORK_TYPE_EVDO_0     CDMA2000 EV-DO版本0(2.1版本)
NETWORK_TYPE_EVDO_A     CDMA2000 EV-DO版本A(2.1版本)
NETWORK_TYPE_EVDO_B     CDMA2000 EV-DO版本B(2.1版本)
NETWORK_TYPE_1xRTT         CDMA2000 1xRTT(2.1版本)
NETWORK_TYPE_IDEN
NETWORK_TYPE_LTE
NETWORK_TYPE_EHRPD
NETWORK_TYPE_HSPAP

 

int

 

getPhoneType()

 

Returns a constant indicating the device phone type.

电话类型

PHONE_TYPE_NONE   未知
PHONE_TYPE_GSM      GSM手机
PHONE_TYPE_CDMA   CDMA手机(2.1版本)
PHONE_TYPE_SIP         via SIP手机

 

String

 

getSimCountryIso()

 

Returns the ISO country code equivalent for the SIM provider's country code.

获取SIM卡中国家ISO代码

 

String

 

getSimOperator()

 

Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM.

获得SIM卡中移动国家代码(MCC)和移动网络代码(MNC)
 

String

 

getSimOperatorName()

 

Returns the Service Provider Name (SPN).

获取服务提供商姓名(中国移动、中国联通等)
 

String

 

getSimSerialNumber()

 

Returns the serial number of the SIM, if applicable.

SIM卡序列号
 

int

 

getSimState()

 

Returns a constant indicating the state of the device SIM card.

SIM卡状态

SIM_STATE_UNKNOWN                   未知状态
SIM_STATE_ABSENT                        未插卡
SIM_STATE_PIN_REQUIRED          需要PIN码,需要SIM卡PIN码解锁
SIM_STATE_PUK_REQUIRED        需要PUK码,需要SIM卡PUK码解锁
SIM_STATE_NETWORK_LOCKED    网络被锁定,需要网络PIN解锁
SIM_STATE_READY                           准备就绪

其中:PIN个人识别码 PUK个人解锁码

 

String

 

getSubscriberId()

 

Returns the unique subscriber ID, for example, the IMSI for a GSM phone.

获得客户标识(IMSI)
 

String

 

getVoiceMailAlphaTag()

 

Retrieves the alphabetic identifier associated with the voice mail number.

 

String

 

getVoiceMailNumber()

 

Returns the voice mail number.

 

boolean

 

hasIccCard()

   

boolean

 

isNetworkRoaming()

 

Returns true if the device is considered roaming on the current network, for GSM purposes.

 

void

 

listen(PhoneStateListener listener, int events)

 

Registers a listener object to receive notification of changes in specified telephony states.

侦听电话的呼叫状态。

电话管理服务接口支持的侦听类型在PhoneStateListener类中定义。

 

PhoneStateListener类 Constants

int

 

LISTEN_CALL_FORWARDING_INDICATOR

 

Listen for changes to the call-forwarding indicator.

侦听呼叫转移指示器改变事件

 

int

 

LISTEN_CALL_STATE

 

Listen for changes to the device call state.

侦听呼叫状态改变事件

 

int

 

LISTEN_CELL_LOCATION

 

Listen for changes to the device's cell location. Note that this will result in frequent callbacks to the listener.

侦听设备位置改变事件

 

int

 

LISTEN_DATA_ACTIVITY

 

Listen for changes to the direction of data traffic on the data connection (cellular).

侦听数据连接的流向改变事件

 

int

 

LISTEN_DATA_CONNECTION_STATE

 

Listen for changes to the data connection state (cellular).

侦听数据连接状态改变事件

 

int

 

LISTEN_MESSAGE_WAITING_INDICATOR

 

Listen for changes to the message-waiting indicator.

侦听消息等待指示器改变事件

 

int

 

LISTEN_NONE

 

Stop listening for updates.

停止侦听

 

int

 

LISTEN_SERVICE_STATE

 

Listen for changes to the network service state (cellular).

侦听网络服务状态

 

int

 

LISTEN_SIGNAL_STRENGTH

 

This constant is deprecated. by LISTEN_SIGNAL_STRENGTHS

侦听网络信号强度

 

int

 

LISTEN_SIGNAL_STRENGTHS

 

Listen for changes to the network signal strengths (cellular).

 
Public Constructors

PhoneStateListener()          

Public Methods

void

 

onCallForwardingIndicatorChanged(boolean cfi)

 

Callback invoked when the call-forwarding indicator changes.

 

void

 

onCallStateChanged(int state, String incomingNumber)

 

Callback invoked when device call state changes.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwydpg.html