ApnSetting

public class ApnSetting
extends Object implements Parcelable

java.lang.Object
   ↳ android.telephony.data.ApnSetting


A class representing an APN configuration.

Summary

Nested classes

class ApnSetting.Builder

 

Constants

int AUTH_TYPE_CHAP

Authentication type for CHAP.

int AUTH_TYPE_NONE

No authentication type.

int AUTH_TYPE_PAP

Authentication type for PAP.

int AUTH_TYPE_PAP_OR_CHAP

Authentication type for PAP or CHAP.

int MVNO_TYPE_GID

MVNO type for group identifier level 1.

int MVNO_TYPE_ICCID

MVNO type for ICCID.

int MVNO_TYPE_IMSI

MVNO type for IMSI.

int MVNO_TYPE_SPN

MVNO type for service provider name.

int PROTOCOL_IP

Protocol type for IP.

int PROTOCOL_IPV4V6

Protocol type for IPV4V6.

int PROTOCOL_IPV6

Protocol type for IPV6.

int PROTOCOL_PPP

Protocol type for PPP.

int TYPE_CBS

APN type for CBS.

int TYPE_DEFAULT

APN type for default data traffic and HiPri traffic.

int TYPE_DUN

APN type for DUN traffic.

int TYPE_EMERGENCY

APN type for Emergency PDN.

int TYPE_FOTA

APN type for accessing the carrier's FOTA portal, used for over the air updates.

int TYPE_HIPRI

APN type for HiPri traffic.

int TYPE_IA

APN type for IA Initial Attach APN.

int TYPE_IMS

APN type for IMS.

int TYPE_MMS

APN type for MMS traffic.

int TYPE_SUPL

APN type for SUPL assisted GPS.

Inherited constants

Fields

public static final Creator<ApnSetting> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

String getApnName()

Returns the name of the APN.

int getApnTypeBitmask()

Returns the bitmask of APN types.

int getAuthType()

Returns the authentication type of the APN.

String getEntryName()

Returns the entry name of the APN.

int getId()

Returns the unique database id for this entry.

InetAddress getMmsProxyAddress()

Returns the MMS proxy address of the APN.

int getMmsProxyPort()

Returns the MMS proxy port of the APN.

Uri getMmsc()

Returns the MMSC Uri of the APN.

int getMvnoType()

Returns the MVNO match type for this APN.

int getNetworkTypeBitmask()

Returns a bitmask describing the Radio Technologies(Network Types) which this APN may use.

String getOperatorNumeric()

Returns the numeric operator ID for the APN.

String getPassword()

Returns the APN password of the APN.

int getProtocol()

Returns the protocol to use to connect to this APN.

InetAddress getProxyAddress()

Returns the proxy address of the APN.

int getProxyPort()

Returns the proxy port of the APN.

int getRoamingProtocol()

Returns the protocol to use to connect to this APN while the device is roaming.

String getUser()

Returns the APN username of the APN.

boolean isEnabled()

Returns the current status of APN.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Constants

AUTH_TYPE_CHAP

int AUTH_TYPE_CHAP

Authentication type for CHAP.

Constant Value: 2 (0x00000002)

AUTH_TYPE_NONE

int AUTH_TYPE_NONE

No authentication type.

Constant Value: 0 (0x00000000)

AUTH_TYPE_PAP

int AUTH_TYPE_PAP

Authentication type for PAP.

Constant Value: 1 (0x00000001)

AUTH_TYPE_PAP_OR_CHAP

int AUTH_TYPE_PAP_OR_CHAP

Authentication type for PAP or CHAP.

Constant Value: 3 (0x00000003)

MVNO_TYPE_GID

int MVNO_TYPE_GID

MVNO type for group identifier level 1.

Constant Value: 2 (0x00000002)

MVNO_TYPE_ICCID

int MVNO_TYPE_ICCID

MVNO type for ICCID.

Constant Value: 3 (0x00000003)

MVNO_TYPE_IMSI

int MVNO_TYPE_IMSI

MVNO type for IMSI.

Constant Value: 1 (0x00000001)

MVNO_TYPE_SPN

int MVNO_TYPE_SPN

MVNO type for service provider name.

Constant Value: 0 (0x00000000)

PROTOCOL_IP

int PROTOCOL_IP

Protocol type for IP.

Constant Value: 0 (0x00000000)

PROTOCOL_IPV4V6

int PROTOCOL_IPV4V6

Protocol type for IPV4V6.

Constant Value: 2 (0x00000002)

PROTOCOL_IPV6

int PROTOCOL_IPV6

Protocol type for IPV6.

Constant Value: 1 (0x00000001)

PROTOCOL_PPP

int PROTOCOL_PPP

Protocol type for PPP.

Constant Value: 3 (0x00000003)

TYPE_CBS

int TYPE_CBS

APN type for CBS.

Constant Value: 128 (0x00000080)

TYPE_DEFAULT

int TYPE_DEFAULT

APN type for default data traffic and HiPri traffic.

Constant Value: 17 (0x00000011)

TYPE_DUN

int TYPE_DUN

APN type for DUN traffic.

Constant Value: 8 (0x00000008)

TYPE_EMERGENCY

int TYPE_EMERGENCY

APN type for Emergency PDN. This is not an IA apn, but is used for access to carrier services in an emergency call situation.

Constant Value: 512 (0x00000200)

TYPE_FOTA

int TYPE_FOTA

APN type for accessing the carrier's FOTA portal, used for over the air updates.

Constant Value: 32 (0x00000020)

TYPE_HIPRI

int TYPE_HIPRI

APN type for HiPri traffic.

Constant Value: 16 (0x00000010)

TYPE_IA

int TYPE_IA

APN type for IA Initial Attach APN.

Constant Value: 256 (0x00000100)

TYPE_IMS

int TYPE_IMS

APN type for IMS.

Constant Value: 64 (0x00000040)

TYPE_MMS

int TYPE_MMS

APN type for MMS traffic.

Constant Value: 2 (0x00000002)

TYPE_SUPL

int TYPE_SUPL

APN type for SUPL assisted GPS.

Constant Value: 4 (0x00000004)

Fields

Public methods

describeContents

int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getApnName

String getApnName ()

Returns the name of the APN.

Returns
String APN name

getApnTypeBitmask

int getApnTypeBitmask ()

Returns the bitmask of APN types.

Apn types are usage categories for an APN entry. One APN entry may support multiple APN types, eg, a single APN may service regular internet traffic ("default") as well as MMS-specific connections.

The bitmask of APN types is calculated from APN types defined in ApnSetting.

Returns
int a bitmask describing the types of the APN

Value is either 0 or combination of TYPE_DEFAULT, TYPE_MMS, TYPE_SUPL, TYPE_DUN, TYPE_HIPRI, TYPE_FOTA, TYPE_IMS, TYPE_CBS, TYPE_IA or TYPE_EMERGENCY.

getAuthType

int getAuthType ()

Returns the authentication type of the APN.

Returns
int authentication type

Value is AUTH_TYPE_NONE, AUTH_TYPE_PAP, AUTH_TYPE_CHAP or AUTH_TYPE_PAP_OR_CHAP.

getEntryName

String getEntryName ()

Returns the entry name of the APN.

Returns
String the entry name for the APN

getId

int getId ()

Returns the unique database id for this entry.

Returns
int the unique database id

getMmsProxyAddress

InetAddress getMmsProxyAddress ()

Returns the MMS proxy address of the APN.

Returns
InetAddress MMS proxy address.

getMmsProxyPort

int getMmsProxyPort ()

Returns the MMS proxy port of the APN.

Returns
int MMS proxy port

getMmsc

Uri getMmsc ()

Returns the MMSC Uri of the APN.

Returns
Uri MMSC Uri.

getMvnoType

int getMvnoType ()

Returns the MVNO match type for this APN.

Returns
int the MVNO match type

Value is MVNO_TYPE_SPN, MVNO_TYPE_IMSI, MVNO_TYPE_GID or MVNO_TYPE_ICCID.

See also:

getNetworkTypeBitmask

int getNetworkTypeBitmask ()

Returns a bitmask describing the Radio Technologies(Network Types) which this APN may use. NetworkType bitmask is calculated from NETWORK_TYPE defined in TelephonyManager. Examples of Network Types include NETWORK_TYPE_UNKNOWN, NETWORK_TYPE_GPRS, NETWORK_TYPE_EDGE.

Returns
int a bitmask describing the Radio Technologies(Network Types)

getOperatorNumeric

String getOperatorNumeric ()

Returns the numeric operator ID for the APN. Numeric operator ID is defined as MCC + MNC.

Returns
String the numeric operator ID

getPassword

String getPassword ()

Returns the APN password of the APN.

Returns
String APN password

getProtocol

int getProtocol ()

Returns the protocol to use to connect to this APN.

Protocol is one of the PDP_type values in TS 27.007 section 10.1.1.

Returns
int the protocol

Value is PROTOCOL_IP, PROTOCOL_IPV6, PROTOCOL_IPV4V6 or PROTOCOL_PPP.

See also:

getProxyAddress

InetAddress getProxyAddress ()

Returns the proxy address of the APN.

Returns
InetAddress proxy address.

getProxyPort

int getProxyPort ()

Returns the proxy port of the APN.

Returns
int proxy port

getRoamingProtocol

int getRoamingProtocol ()

Returns the protocol to use to connect to this APN while the device is roaming.

Roaming protocol is one of the PDP_type values in TS 27.007 section 10.1.1.

Returns
int the roaming protocol

Value is PROTOCOL_IP, PROTOCOL_IPV6, PROTOCOL_IPV4V6 or PROTOCOL_PPP.

getUser

String getUser ()

Returns the APN username of the APN.

Returns
String APN username

isEnabled

boolean isEnabled ()

Returns the current status of APN. true : enabled APN. false : disabled APN.

Returns
boolean the current status

writeToParcel

void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.

This value must never be null.

flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.