Telephony
  • Telephony
  • Permissions
  • Sending An SMS
  • Query SMS
  • Query Conversations
  • Listen Incoming SMS
  • Network Data and Metrics
  • Start Phone Call
  • Executing in Background
Powered by GitBook
On this page
  • isSmsCapable
  • cellularDataState
  • callState
  • dataActivity
  • networkOperator
  • networkOperatorName
  • dataNetworkType
  • phoneType
  • simOperator
  • simOperatorName
  • simState
  • isNetworkRoaming
  • signalStrengths
  • serviceState
  • DataState
  • CallState
  • DataActivity
  • NetworkType
  • PhoneType
  • SimState
  • SignalStrength
  • ServiceState

Was this helpful?

Network Data and Metrics

PreviousListen Incoming SMSNextStart Phone Call

Last updated 4 years ago

Was this helpful?

Methods mentioned in this section call upon the relevant methods on Android's class.

Check for more details on how these methods function.

isSmsCapable

Returns Future<bool>

Checks if the device has necessary features to send and receive SMS.

bool isSmsCapable = await telephony.isSmsCapable;

cellularDataState

Returns Future<>

Returns a constant indicating the current data connection state (cellular).

DataState state = await telephony.cellularDataState;

callState

Returns Future<>

Returns a constant that represents the current state of all phone calls.

CallState state = await telephony.callState;

dataActivity

Returns a constant indicating the type of activity on a data connection (cellular).

DataActivity activity = await telephony.dataActivity;

networkOperator

Returns Future<String>

Returns the numeric name (MCC+MNC) of current registered operator.

Availability: Only when user is registered to a network.

String networkOperator = await telephony.networkOperator;

networkOperatorName

Returns Future<String>

Returns the alphabetic name of current registered operator.

Availability: Only when user is registered to a network.

String operatorName = await telephony.networkOperatorName;

dataNetworkType

Requires READ_PHONE_STATE permission.

Add the following in your AndroidManifest.xml

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

Returns a constant indicating the radio technology (network type) currently in use on the device for data transmission.

NetworkType type = await telephony.dataNetworkType;

phoneType

Returns a constant indicating the device phone type. This indicates the type of radio used to transmit voice calls.

PhoneType type = await telephony.phoneType;

simOperator

Returns Future<String>

Returns the MCC+MNC (mobile country code + mobile network code) of the provider of the SIM. 5 or 6 decimal digits.

String simOperator = await telephony.simOperator;

simOperatorName

Returns Future<String>

Returns the Service Provider Name (SPN).

String simOperatorName = await telephony.simOperatorName;

simState

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

SimState state = await telephony.simState;

isNetworkRoaming

Returns Future<bool>

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

Availability: Only when user registered to a network.

bool isNetworkRoaming = await telephony.isNetworkRoaming;

signalStrengths

Requires Android build version 29 --> Android Q

List<SignalStrength> strenghts = await telephony.signalStrengths;

serviceState

Requires Android build version 26 --> Android O

Requires permissions ACCESS_COARSE_LOCATION and READ_PHONE_STATE

Add the following in your AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

Returns current voice service state.

ServiceState state = await telephony.serviceState;

DataState

Values

DISCONNECTED

CONNECTING

CONNECTED

SUSPENDED

UNKNOWN

CallState

Values

IDLE

RINGING

OFFHOOK

DataActivity

Values

NONE

IN

OUT

INOUT

DORMANT

NetworkType

Values

UNKNOWN

GPRS

EDGE

UMTS

CDMA

EVDO_0

EVDO_A

TYPE_1xRTT

HSDPA

HSUPA

HSPA

IDEN

EVDO_B

LTE

EHRPD

HSPAP

GSM

TD_SCDMA

IWLAN

LTE_CA

NR

PhoneType

Values

NONE

GSM

CDMS

SIP

SimState

Values

UNKNOWN

ABSENT

PIN_REQUIRED

PUK_REQUIRED

NETWORK_LOCKED

READY

NOT_READY

PERM_DISABLED

CARD_IO_ERROR

CARD_RESTRICTED

LOADED

PRESENT

SignalStrength

Values

NONE_OR_UNKNOWN

POOR

MODERATE

GOOD

GREAT

ServiceState

Values

IN_SERVICE

OUT_OF_SERVICE

EMERGENCY_ONLY

POWER_OFF

Returns Future<>

Result may be unreliable on CDMA networks (use to determine if on a CDMA network).

Result may be unreliable on CDMA networks (use to determine if on a CDMA network).

Returns Future<>

Returns Future<>

Availability: must be SIM_STATE_READY

Availability: must be SIM_STATE_READY

Returns Future<>

Returns Future<List<>>

Returns a List of or an empty List if there are no valid measurements.

Returns Future<>

TelephonyManager
Android Develop Docs
DataState
CallState
DataActivity
phoneType
phoneType
NetworkType
PhoneType
SimState
SimState
SimState
SignalStrength
SignalStrength
ServiceState