This library reads the sim (both, also dual sim), example Serial Number SIM-1 and SIM-2, Number Phone SIM-1 and SIM-2, etc.
SimCard
Author: Devil-App
Version: 2
Very simple to use:
Rel 2 -- > ADD THIS
SimCard
Author: Devil-App
Version: 2
- SimCard
Methods:- GetDataActivity As String
Returns a constant indicating the type of activity on a data connection (cellular).
Return DATA_ACTIVITY_NONE
Return DATA_ACTIVITY_IN
Return DATA_ACTIVITY_OUT
Return DATA_ACTIVITY_INOUT
Return DATA_ACTIVITY_DORMANT
Example:<code>
Dim sim As SimCard
Dim torna As String
torna = sim.GetDataActivity </code> - GetDataState As String
Returns a constant indicating the current data connection state (cellular).
Return DATA_DISCONNECTED
Return DATA_CONNECTING
Return DATA_CONNECTED
Return DATA_SUSPENDED
Example:<code>
Dim sim As SimCard
Dim torna As String
torna = sim.GetDataState </code> - GetLine1Number As String
Reads NumberPhone-1 and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetLine1Number</code> - GetLine2Number As String
Reads NumberPhone-2 and returns its content as a string.
Example:<code>
Note: Utilize sim.IsDualSIM
Dim sim As SimCard
Dim text As String
text = sim.GetLine2Number</code> - GetMmsAgent As String
Reads MMS user Agent and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetMmsAgent</code> - GetMmsURL As String
Reads MMS user Agent profile URL and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetMmsURL</code> - GetNetworkCountryIso As String
Returns the ISO country code equivalent of the current registered operator's MCC (Mobile Country Code) and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetNetworkCountryIso</code> - GetNetworkOperator As String
Returns the numeric name (MCC+MNC) of current registered operator and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetNetworkOperator</code> - GetNetworkOperatorName As String
Returns the operator name (MCC+MNC) of current registered operator and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetNetworkOperator</code> - GetPhoneType As String
Returns a constant indicating the device phone type. This indicates the type of radio used to transmit voice calls.
Return PHONE_TYPE_NONE
Return PHONE_TYPE_GSM
Return PHONE_TYPE_CDMA
Return PHONE_TYPE_SIP
Example:<code>
Dim sim As SimCard
Dim torna As String
torna = sim.GetPhoneType </code> - GetSimCountryIso As String
Returns the ISO country code equivalent for the SIM provider's country code and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetSimCountryIso</code> - GetSimOperator As String
Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetSimOperator</code> - GetSimOperatorName As String
Returns the Service Provider Name (SPN) and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetSimOperatorName</code> - GetSimSerialNumber1 As String
Returns the serial number of the SIM, if applicable and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetSimSerialNumber</code> - GetSimSerialNumber2 As String
Returns the serial number of the SIM-2, if applicable and returns its content as a string.
Example:<code>
Note: Utilize sim.IsDualSIM
Dim sim As SimCard
Dim text As String
text = sim.GetSimSerialNumber</code> - GetSimState As String
Returns a constant indicating the state of the device SIM card.
Return SIM_STATE_UNKNOWN
Return SIM_STATE_ABSENT - SIM card state: no SIM card is available in the device
Return SIM_STATE_PIN_REQUIRED - SIM card state: Locked: requires the user's SIM PIN to unlock
Return SIM_STATE_PUK_REQUIRED - SIM card state: Locked: requires the user's SIM PUK to unlock
Return SIM_STATE_NETWORK_LOCKED - SIM card state: Locked: requries a network PIN to unlock
Return SIM_STATE_READY
Example:<code>
Dim sim As SimCard
Dim torna As String
torna = sim.GetSimState </code> - GetSubscriberId As String
Returns the unique subscriber ID, for example, the IMSI for a GSM phone and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetSubscriberId</code> - GetVoiceMailAlphaTag As String
Retrieves the alphabetic identifier associated with the voice mail number and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetVoiceMailAlphaTag</code> - GetVoiceMailNumber As String
Returns the voice mail number and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.GetVoiceMailNumber </code> - HasIccCard As Boolean
Returns true if a ICC card is present.
Example:<code>
Dim sim As SimCard
Dim vero As boolean
vero = sim.HasIccCard </code> - Imei As String
Reads IMEI for GSM and the MEDI or ESN for CDMA phones and returns its content as a string.
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.Imei</code> - Imei2 As String
Reads IMEI2 for GSM and the MEDI or ESN for CDMA phones and returns its content as a string.
Note: Utilize sim.IsDualSIM and IsSIM2Ready
Example:<code>
Dim sim As SimCard
Dim text As String
text = sim.Imei2</code> - Initialize
Initialize - <link>Documentation:|http://developer.android.com/refere...TelephonyManager.html#SIM_STATE_ABSENT</link>.
Example:<code>
Dim sim As SimCard
sim.Initialize()</code> - IsDualSIM As Boolean
Check if is DUAL SIM.
Example:<code>
Dim sim As SimCard
Dim vero As boolean
vero = sim.IsDualSIM</code> - IsNetworkRoaming As Boolean
Returns true if the device is considered roaming on the current network, for GSM purposes.
Example:<code>
Dim sim As SimCard
Dim vero As boolean
vero = sim.IsNetworkRoaming </code>
- android.permission.READ_PHONE_STATE
- GetDataActivity As String
Very simple to use:
B4X:
sim.Initialize()
Log("1: - " & sim.GetDataActivity)
Log("2: - " & sim.GetDataState)
Log("3: - " & sim.GetLine1Number)
Log("4: - " & sim.GetLine2Number)
Log("5: - " & sim.GetMmsAgent)
Log("6: - " & sim.GetMmsURL)
Log("7: - " & sim.GetNetworkCountryIso)
Log("8: - " & sim.GetNetworkOperator)
Log("9: - " & sim.GetPhoneType)
Log("10: - " & sim.GetSimCountryIso)
Log("11: - " & sim.GetSimOperator)
Log("12: - " & sim.GetSimOperatorName)
Log("13: - " & sim.GetSimState)
Log("14: - " & sim.GetSubscriberId)
Log("15: - " & sim.GetVoiceMailAlphaTag)
Log("16: - " & sim.GetVoiceMailNumber)
Log("17: - " & sim.HasIccCard)
Log("18: - " & sim.Imei)
Log("19: - " & sim.Imei2)
Log("20: - " & sim.IsNetworkRoaming)
Log("21: - " & sim.IsDualSIM)
Log("22: - " & sim.GetSimSerialNumber1)
Log("23: - " & sim.GetSimSerialNumber2)
Log("24: - " & sim.GetLine2Number)
Log("25: - " & sim.GetNetworkOperatorName)
Rel 2 -- > ADD THIS
Attachments
Last edited: