Package | com.wadedwalker.nativeExtension.telephone |
Class | public final class TelephoneManager |
Inheritance | TelephoneManager ![]() |
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
The TelephoneManager
class is a Native Extension built to mimic many features
of the TelephonyManager API of Android. One of the biggest features of this native extension is
to be able to pause video/audio, games, programs, etc by knowing when a phone call happens. This will
keep the phone call from fully interrupting your application and allow you to save the application
state when a phone call occurs, and be able to restore the state when the user returns
to the application.
Other features behind this extension let you retrieve lots of different information about the phone the application is running on.
NOTE: Many of the methods and events require the Android permission
READ_PHONE_STATE
.
Property | Defined By | ||
---|---|---|---|
![]() [static] [read-only]
Deterimines whether or not this native extension is supported on the device the app is running on. | TelephoneManager |
Method | Defined By | ||
---|---|---|---|
Creates a TelephoneManager Native Extension object. | TelephoneManager | ||
![]()
Properly shut down this Native Extension. | TelephoneManager | ||
![]()
Returns a constant indicating the call state (cellular) on the device. | TelephoneManager | ||
![]()
Returns a constant indicating the type of activity on a data connection (cellular). | TelephoneManager | ||
![]()
Returns a constant indicating the current data connection state (cellular). | TelephoneManager | ||
![]()
Returns the unique device ID, for example, the IMEI for GSM and the MEID or ESN for CDMA
phones. | TelephoneManager | ||
![]()
Returns the software version number for the device, for example, the IMEI/SV for GSM
phones. | TelephoneManager | ||
![]()
Returns the Group Identifier Level1 for a GSM phone. | TelephoneManager | ||
![]()
Returns the MMS user agent profile URL. | TelephoneManager | ||
![]()
Returns the MMS user agent. | TelephoneManager | ||
![]()
Returns the ISO country code equivalent of the current registered operator's MCC
(Mobile Country Code). | TelephoneManager | ||
![]()
Returns the numeric name (MCC+MNC) of current registered operator. | TelephoneManager | ||
![]()
Returns the alphabetic name of current registered operator. | TelephoneManager | ||
![]()
Returns the NETWORK_TYPE_xxxx for current data connection. | TelephoneManager | ||
![]()
Returns the number of phones available. | TelephoneManager | ||
![]()
Returns the phone number for the device. | TelephoneManager | ||
![]()
Returns a constant indicating the device phone type. | TelephoneManager | ||
![]()
Returns the ISO country code equivalent for the SIM provider's country code. | TelephoneManager | ||
![]()
Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. | TelephoneManager | ||
![]()
Returns the Service Provider Name (SPN). | TelephoneManager | ||
![]()
Returns the serial number of the SIM, if applicable. | TelephoneManager | ||
![]()
Returns a constant indicating the state of the device SIM card. | TelephoneManager | ||
![]()
Returns the unique subscriber ID, for example, the IMSI for a GSM phone. | TelephoneManager | ||
![]()
Retrieves the alphabetic identifier associated with the voice mail number. | TelephoneManager | ||
![]()
Returns the voice mail number. | TelephoneManager | ||
![]()
Whether the phone supports hearing aid compatibility. | TelephoneManager | ||
![]()
Returns true if the device is considered roaming on the current network,
for GSM purposes. | TelephoneManager | ||
![]()
Returns true if the current device supports sms service. | TelephoneManager | ||
![]()
Whether the phone supports TTY mode. | TelephoneManager | ||
![]()
Whether the device is a world phone. | TelephoneManager |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when a call state change has occured on the phone. | TelephoneManager | |||
This event gets dispatched when data activity has changed. | TelephoneManager | |||
This event gets dispatched when data connection has changed. | TelephoneManager |
Constant | Defined By | ||
---|---|---|---|
![]() [static]
Device call state: No activity. | TelephoneManager | ||
![]() [static]
Device call state: At least one call exists that is dialing, active, or on hold, and no calls are
ringing or waiting. | TelephoneManager | ||
![]() [static]
Device call state: Ringing. | TelephoneManager | ||
![]() [static]
Data connection is active, but physical link is down. | TelephoneManager | ||
![]() [static]
Data connection activity: Currently receiving IP PPP traffic. | TelephoneManager | ||
![]() [static]
Data connection activity: Currently both sending and receiving IP PPP traffic. | TelephoneManager | ||
![]() [static]
Data connection activity: No traffic. | TelephoneManager | ||
![]() [static]
Data connection activity: Currently sending IP PPP traffic. | TelephoneManager | ||
![]() [static]
Data connection state: Connected. | TelephoneManager | ||
![]() [static]
Data connection state: Currently setting up a data connection. | TelephoneManager | ||
![]() [static]
Data connection state: Disconnected. | TelephoneManager | ||
![]() [static]
Data connection state: Suspended. | TelephoneManager | ||
![]() [static]
Current network is 1xRTT. | TelephoneManager | ||
![]() [static]
Current network is CDMA. | TelephoneManager | ||
![]() [static]
Current network is EDGE. | TelephoneManager | ||
![]() [static]
Current network is eHRPD. | TelephoneManager | ||
![]() [static]
Current network is EVDO revision 0. | TelephoneManager | ||
![]() [static]
Current network is EVDO revision A. | TelephoneManager | ||
![]() [static]
Current network is EVDO revision B. | TelephoneManager | ||
![]() [static]
Current network is GRPS. | TelephoneManager | ||
![]() [static]
Current network is HSDPA. | TelephoneManager | ||
![]() [static]
Current network is HSPA. | TelephoneManager | ||
![]() [static]
Current network is HSPA+. | TelephoneManager | ||
![]() [static]
Current network is HSUPA. | TelephoneManager | ||
![]() [static]
Current network is iDen. | TelephoneManager | ||
![]() [static]
Current network is LTE. | TelephoneManager | ||
![]() [static]
Current network is UMTS. | TelephoneManager | ||
![]() [static]
Current network is unknown. | TelephoneManager | ||
![]() [static]
Phone radio is CDMA. | TelephoneManager | ||
![]() [static]
Phone radio is GSM. | TelephoneManager | ||
![]() [static]
No phone radio. | TelephoneManager | ||
![]() [static]
Phone is via SIP which is used in VoIP communication. | TelephoneManager | ||
![]() [static]
SIM card state: no SIM card is available in the device. | TelephoneManager | ||
![]() [static]
SIM card state: Locked: requries a network PIN to unlock. | TelephoneManager | ||
![]() [static]
SIM card state: Locked: requires the user's SIM PIN to unlock. | TelephoneManager | ||
![]() [static]
SIM card state: Locked: requires the user's SIM PUK to unlock. | TelephoneManager | ||
![]() [static]
SIM card state: Ready. | TelephoneManager | ||
![]() [static]
SIM card state: Unknown. | TelephoneManager |
![]() | property |
isSupported:Boolean
[read-only] Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Deterimines whether or not this native extension is supported on the device the app is running on. This does not check for OS version to determine if specific methods that require newer OS versions are allowed to be used or not.
public static function get isSupported():Boolean
![]() | () | Constructor |
public function TelephoneManager()
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Creates a TelephoneManager
Native Extension object.
![]() | () | method |
public final function dispose():void
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Properly shut down this Native Extension.
![]() | () | method |
public final function getCallState():int
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns a constant indicating the call state (cellular) on the device. Possible values are:
CALL_STATE_IDLE
, CALL_STATE_RINGING
, or CALL_STATE_OFFHOOK
.
int |
See also
![]() | () | method |
public final function getDataActivity():int
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns a constant indicating the type of activity on a data connection (cellular).
Returnsint |
See also
![]() | () | method |
public final function getDataState():int
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns a constant indicating the current data connection state (cellular).
Returnsint |
See also
![]() | () | method |
public final function getDeviceId():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the unique device ID, for example, the IMEI for GSM and the MEID or ESN for CDMA phones.
NOTE: Requires Android Permission: READ_PHONE_STATE
ReturnsString |
![]() | () | method |
public final function getDeviceSoftwareVersion():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the software version number for the device, for example, the IMEI/SV for GSM
phones. Returns null
if the software version is not available.
NOTE: Requires Android Permission: READ_PHONE_STATE
ReturnsString |
![]() | () | method |
public final function getGroupIdLevel1():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the Group Identifier Level1 for a GSM phone. Returns null
if it
is unavailable.
NOTE: Requires Android Permission: READ_PHONE_STATE
NOTE: Requires API level 18 (Android 4.3.x Jelly Bean)
ReturnsString |
![]() | () | method |
public final function getMmsUAProfUrl():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the MMS user agent profile URL.
NOTE: Requires API level 19 (Android 4.4.x KitKat)
ReturnsString |
![]() | () | method |
public final function getMmsUserAgent():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the MMS user agent.
NOTE: Requires API level 19 (Android 4.4.x KitKat)
ReturnsString |
![]() | () | method |
public final function getNetworkCountryIso():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the ISO country code equivalent of the current registered operator's MCC (Mobile Country Code).
Availability: Only when user is registered to a network. Result may be unreliable on CDMA
networks (use getPhoneType()
to determine if on a CDMA network).
String |
See also
![]() | () | method |
public final function getNetworkOperator():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the numeric name (MCC+MNC) of current registered operator.
Availability: Only when user is registered to a network. Result may be unreliable on CDMA
networks (use getPhoneType()
to determine if on a CDMA network).
String |
See also
![]() | () | method |
public final function getNetworkOperatorName():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the alphabetic name of current registered operator.
ReturnsString |
![]() | () | method |
public final function getNetworkType():int
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the NETWORK_TYPE_xxxx for current data connection. Use the
TelephoneManager.NETWORK_TYPE_xxxx
constants to check against.
int |
![]() | () | method |
public final function getPhoneCount():int
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 20.0 |
Returns the number of phones available. Returns 1 for Single standby mode (Single SIM functionality) Returns 2 for Dual standby mode (Dual SIM functionality).
NOTE: Requires API level 23 (Android 6.0.x Marshmallow)
Returnsint |
![]() | () | method |
public final function getPhoneNumber():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the phone number for the device.
NOTE: Requires Android Permission: READ_PHONE_STATE
ReturnsString |
![]() | () | method |
public final function getPhoneType():int
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns a constant indicating the device phone type. This indicates the type of radio used to transmit voice calls.
Returnsint |
See also
![]() | () | method |
public final function getSimCountryIso():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the ISO country code equivalent for the SIM provider's country code.
ReturnsString |
![]() | () | method |
public final function getSimOperator():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. 5 or 6 decimal digits.
Availability: SIM state must be SIM_STATE_READY
String |
See also
![]() | () | method |
public final function getSimOperatorName():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the Service Provider Name (SPN).
Availability: SIM state must be SIM_STATE_READY
String |
See also
![]() | () | method |
public final function getSimSerialNumber():int
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the serial number of the SIM, if applicable. Returns null
if
it is unavailable.
NOTE: Requires Android Permission: READ_PHONE_STATE.
Returnsint |
![]() | () | method |
public final function getSimState():int
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns a constant indicating the state of the device SIM card.
Returnsint |
See also
![]() | () | method |
public final function getSubscriberId():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the unique subscriber ID, for example, the IMSI for a GSM phone.
Returns null
if it is unavailable.
NOTE: Requires Android Permission: READ_PHONE_STATE.
ReturnsString |
![]() | () | method |
public final function getVoiceMailAlphaTag():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Retrieves the alphabetic identifier associated with the voice mail number.
NOTE: Requires Android Permission: READ_PHONE_STATE.
ReturnsString |
![]() | () | method |
public final function getVoiceMailNumber():String
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns the voice mail number. Returns null
if it is unavailable.
NOTE: Requires Android Permission: READ_PHONE_STATE.
ReturnsString |
![]() | () | method |
public final function isHearingAidCompatibilitySupported():Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 20.0 |
Whether the phone supports hearing aid compatibility.
NOTE: Requires API level 23 (Android 6.0.x Marshmallow)
ReturnsBoolean — true if the device supports hearing aid compatibility, and false otherwise.
|
![]() | () | method |
public final function isNetworkRoaming():Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Returns true
if the device is considered roaming on the current network,
for GSM purposes.
Availability: Only when user registered to a network.
ReturnsBoolean |
![]() | () | method |
public final function isSmsCapable():Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 20.0 |
Returns true
if the current device supports sms service.
If true
, this means that the device supports both sending and receiving sms
via the telephony network.
NOTE: Voicemail waiting sms, cell broadcasting sms, and MMS are disabled when device doesn't support sms.
NOTE: Requires API level 21 (Android 5.0.x Lollipop)
ReturnsBoolean |
![]() | () | method |
public final function isTtyModeSupported():Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 20.0 |
Whether the phone supports TTY mode.
NOTE: Requires API level 23 (Android 6.0.x Marshmallow)
ReturnsBoolean — true if the device supports TTY mode, and false otherwise.
|
![]() | () | method |
public final function isWorldPhone():Boolean
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 20.0 |
Whether the device is a world phone.
NOTE: Requires API level 23 (Android 6.0.x Marshmallow)
ReturnsBoolean — true if the device is a world phone, and false otherwise.
|
![]() | Event |
com.wadedwalker.nativeExtension.telephone.events.CallStateEvent
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Dispatched when a call state change has occured on the phone.
The three states are: CALL_STATE_RINGING
, CALL_STATE_IDLE
, and
CALL_STATE_OFFHOOK
. When this event is dispatched, if the type is of
CALL_STATE_RINGING
then the phoneNumber
property will be populated with
the phone number if it can be retrieved.
NOTE: The phone number is not formatted.
NOTE: Requires Android Permission: READ_PHONE_STATE.
This event has the following properties in addition to standard event properties:
Property | Value |
---|---|
callState | int value representing the current call state. |
phoneNumber | String value containing an unformatted phone number.
null if the call state is not CALL_STATE_RINGING . |
See also
![]() | Event |
com.wadedwalker.nativeExtension.telephone.events.DataActivityEvent
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
This event gets dispatched when data activity has changed. This event will tell you what the current internet activity is.
This event has the following property in addition to standard event properties:
Property | Value |
---|---|
activityChange | int value representing the current activity state. |
![]() | Event |
com.wadedwalker.nativeExtension.telephone.events.DataConnectionStateEvent
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
This event gets dispatched when data connection has changed.
This event has the following properties in addition to standard event properties:
Property | Value |
---|---|
connectionState | int value representing the connection state. |
networkType | String value represnting the type of network the device is on. |
![]() | Constant |
public static const CALL_STATE_IDLE:int = 0x00000000
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Device call state: No activity.
![]() | Constant |
public static const CALL_STATE_OFFHOOK:int = 0x00000002
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Device call state: At least one call exists that is dialing, active, or on hold, and no calls are ringing or waiting. If the user makes an outgoing call, it is possible for this event type to trigger during the ringing phase and offhook phase.
![]() | Constant |
public static const CALL_STATE_RINGING:int = 0x00000001
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Device call state: Ringing. A new call arrived and is ringing or waiting. In the latter case, another call is already active.
![]() | Constant |
public static const DATA_ACTIVITY_DORMANT:int = 0x00000004
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Data connection is active, but physical link is down.
![]() | Constant |
public static const DATA_ACTIVITY_IN:int = 0x00000001
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Data connection activity: Currently receiving IP PPP traffic.
![]() | Constant |
public static const DATA_ACTIVITY_INOUT:int = 0x00000003
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Data connection activity: Currently both sending and receiving IP PPP traffic.
![]() | Constant |
public static const DATA_ACTIVITY_NONE:int = 0x00000000
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Data connection activity: No traffic.
![]() | Constant |
public static const DATA_ACTIVITY_OUT:int = 0x00000002
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Data connection activity: Currently sending IP PPP traffic.
![]() | Constant |
public static const DATA_CONNECTED:int = 0x00000002
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Data connection state: Connected. IP traffic should be available.
![]() | Constant |
public static const DATA_CONNECTING:int = 0x00000001
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Data connection state: Currently setting up a data connection.
![]() | Constant |
public static const DATA_DISCONNECTED:int = 0x00000000
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Data connection state: Disconnected. IP traffic not available.
![]() | Constant |
public static const DATA_SUSPENDED:int = 0x00000003
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Data connection state: Suspended. The connection is up, but IP traffic is temporarily unavailable. For example, in a 2G network, data activity may be suspended when a voice call arrives.
![]() | Constant |
public static const NETWORK_TYPE_1xRTT:int = 0x00000007
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is 1xRTT.
![]() | Constant |
public static const NETWORK_TYPE_CDMA:int = 0x00000004
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is CDMA.
![]() | Constant |
public static const NETWORK_TYPE_EDGE:int = 0x00000002
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is EDGE.
![]() | Constant |
public static const NETWORK_TYPE_EHRPD:int = 0x0000000e
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is eHRPD.
![]() | Constant |
public static const NETWORK_TYPE_EVDO_0:int = 0x00000005
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is EVDO revision 0.
![]() | Constant |
public static const NETWORK_TYPE_EVDO_A:int = 0x00000006
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is EVDO revision A.
![]() | Constant |
public static const NETWORK_TYPE_EVDO_B:int = 0x0000000c
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is EVDO revision B.
![]() | Constant |
public static const NETWORK_TYPE_GRPS:int = 0x00000001
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is GRPS.
![]() | Constant |
public static const NETWORK_TYPE_HSDPA:int = 0x00000008
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is HSDPA.
![]() | Constant |
public static const NETWORK_TYPE_HSPA:int = 0x0000000a
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is HSPA.
![]() | Constant |
public static const NETWORK_TYPE_HSPAP:int = 0x0000000f
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is HSPA+.
![]() | Constant |
public static const NETWORK_TYPE_HSUPA:int = 0x00000009
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is HSUPA.
![]() | Constant |
public static const NETWORK_TYPE_IDEN:int = 0x0000000b
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is iDen.
![]() | Constant |
public static const NETWORK_TYPE_LTE:int = 0x0000000d
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is LTE.
![]() | Constant |
public static const NETWORK_TYPE_UMTS:int = 0x00000003
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is UMTS.
![]() | Constant |
public static const NETWORK_TYPE_UNKNOWN:int = 0x00000000
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Current network is unknown.
![]() | Constant |
public static const PHONE_TYPE_CDMA:int = 0x00000002
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Phone radio is CDMA.
![]() | Constant |
public static const PHONE_TYPE_GSM:int = 0x00000001
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Phone radio is GSM.
![]() | Constant |
public static const PHONE_TYPE_NONE:int = 0x00000000
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
No phone radio.
![]() | Constant |
public static const PHONE_TYPE_SIP:int = 0x00000003
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
Phone is via SIP which is used in VoIP communication.
![]() | Constant |
public static const SIM_STATE_ABSENT:int = 0x00000001
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
SIM card state: no SIM card is available in the device.
![]() | Constant |
public static const SIM_STATE_NETWORK_LOCKED:int = 0x00000004
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
SIM card state: Locked: requries a network PIN to unlock.
![]() | Constant |
public static const SIM_STATE_PIN_REQUIRED:int = 0x00000002
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
SIM card state: Locked: requires the user's SIM PIN to unlock.
![]() | Constant |
public static const SIM_STATE_PUK_REQUIRED:int = 0x00000003
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
SIM card state: Locked: requires the user's SIM PUK to unlock.
![]() | Constant |
public static const SIM_STATE_READY:int = 0x00000005
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
SIM card state: Ready.
![]() | Constant |
public static const SIM_STATE_UNKNOWN:int = 0x00000000
Language Version : | ActionScript 3.0 |
Runtime Versions : | AIR 2.5 |
SIM card state: Unknown.
The following example shows how to listen for a telephone call.
NOTE: Requires Android Permission: READ_PHONE_STATE.
package { import flash.display.Sprite; import com.wadedwalker.nativeExtension.telephone.TelephoneManager; import com.wadedwalker.nativeExtension.telephone.events.CallStateEvent; final public class MyAndroidApp extends Sprite { public var teleMan:TelephoneManager; final public function MyAndroidApp() { teleMan = new TelephoneManager(); teleMan.addEventListener(CallStateEvent.CALL_STATE_CHANGE, onCallStateChange); } final public function onCallStateChange(e:CallStateChange):void { trace("Call state = " + e.callState); if (e.callState == TelephoneManager.CALL_STATE_RINGING) { trace("Incoming phone number = " + e.phoneNumber); // pause application and save all data } else if (e.callState == TelephoneManager.CALL_STATE_IDLE) { // resume application } } } }