从TelephonyManager获取设备信息

来源:互联网 发布:知乎公司 编辑:程序博客网 时间:2024/04/30 09:37
直接看api文档就一目了然了:

http://developer.android.com/reference/android/telephony/TelephonyManager.html#getSubscriberId()


Public MethodsList<CellInfo>getAllCellInfo()

Returns all observed cell information from all radios on the device including the primary and neighboring cells.
intgetCallState()
Returns a constant indicating the call state (cellular) on the device.
CellLocationgetCellLocation()
Returns the current location of the device.
intgetDataActivity()
Returns a constant indicating the type of activity on a data connection (cellular).
intgetDataState()
Returns a constant indicating the current data connection state (cellular).
StringgetDeviceId()
Returns the unique device ID, for example, the IMEI for GSM and the MEID or ESN for CDMA phones.
StringgetDeviceSoftwareVersion()
Returns the software version number for the device, for example, the IMEI/SV for GSM phones.
StringgetGroupIdLevel1()
Returns the Group Identifier Level1 for a GSM phone.
StringgetLine1Number()
Returns the phone number string for line 1, for example, the MSISDN for a GSM phone.
StringgetMmsUAProfUrl()
Returns the MMS user agent profile URL.
StringgetMmsUserAgent()
Returns the MMS user agent.
List<NeighboringCellInfo>getNeighboringCellInfo()
Returns the neighboring cell information of the device.
StringgetNetworkCountryIso()
Returns the ISO country code equivalent of the current registered operator's MCC (Mobile Country Code).
StringgetNetworkOperator()
Returns the numeric name (MCC+MNC) of current registered operator.
StringgetNetworkOperatorName()
Returns the alphabetic name of current registered operator.
intgetNetworkType()intgetPhoneType()
Returns a constant indicating the device phone type.
StringgetSimCountryIso()
Returns the ISO country code equivalent for the SIM provider's country code.
StringgetSimOperator()
Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM.
StringgetSimOperatorName()
Returns the Service Provider Name (SPN).
StringgetSimSerialNumber()
Returns the serial number of the SIM, if applicable.
intgetSimState()
Returns a constant indicating the state of the device SIM card.
StringgetSubscriberId()
Returns the unique subscriber ID, for example, the IMSI for a GSM phone.
StringgetVoiceMailAlphaTag()
Retrieves the alphabetic identifier associated with the voice mail number.
StringgetVoiceMailNumber()
Returns the voice mail number.
booleanhasIccCard()booleanisNetworkRoaming()
Returns true if the device is considered roaming on the current network, for GSM purposes.
voidlisten(PhoneStateListener listener, int events)
Registers a listener object to receive notification of changes in specified telephony states.

原创粉丝点击