Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/telephony/data/ApnSetting#nestedclasses) \| [Constants](https://developer.android.com/reference/android/telephony/data/ApnSetting#constants) \| [Inherited Constants](https://developer.android.com/reference/android/telephony/data/ApnSetting#inhconstants) \| [Fields](https://developer.android.com/reference/android/telephony/data/ApnSetting#lfields) \| [Methods](https://developer.android.com/reference/android/telephony/data/ApnSetting#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/telephony/data/ApnSetting#inhmethods)

# ApnSetting

*** ** * ** ***


`
public


class
ApnSetting
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.telephony.data.ApnSetting |

<br />

*** ** * ** ***

An Access Point Name (APN) configuration for a carrier data connection.

The APN provides configuration to connect a cellular network device to an IP data network. A
carrier uses the name, type and other configuration in an `APNSetting` to decide which IP
address to assign, any security methods to apply, and how the device might be connected to
private networks.

Use `https://developer.android.com/reference/android/telephony/data/ApnSetting.Builder` to create new instances.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/telephony/data/ApnSetting.Builder` Provides a convenient way to set the fields of a `https://developer.android.com/reference/android/telephony/data/ApnSetting` when creating a new instance. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#AUTH_TYPE_CHAP` Authentication type for CHAP. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#AUTH_TYPE_NONE` Authentication is not required. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#AUTH_TYPE_PAP` Authentication type for PAP. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#AUTH_TYPE_PAP_OR_CHAP` Authentication type for PAP or CHAP. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#MVNO_TYPE_GID` MVNO type for group identifier level 1. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#MVNO_TYPE_ICCID` MVNO type for ICCID. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#MVNO_TYPE_IMSI` MVNO type for IMSI. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#MVNO_TYPE_SPN` MVNO type for service provider name. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_IP` Internet protocol. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_IPV4V6` Virtual PDP type introduced to handle dual IP stack UE capability. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_IPV6` Internet protocol, version 6. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_NON_IP` Transfer of Non-IP data to external packet data network. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_PPP` Point to point protocol. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_UNSTRUCTURED` Transfer of Unstructured data to the Data Network via N6. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_BIP` APN type for BIP. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_CBS` APN type for CBS. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_DEFAULT` APN type for default data traffic. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_DUN` APN type for DUN traffic. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_EMERGENCY` APN type for Emergency PDN. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_ENTERPRISE` APN type for ENTERPRISE. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_FOTA` APN type for accessing the carrier's FOTA portal, used for over the air updates. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_HIPRI` APN type for HiPri traffic. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_IA` APN type for IA Initial Attach APN. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_IMS` APN type for IMS. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_MCX` APN type for MCX (Mission Critical Service) where X can be PTT/Video/Data |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_MMS` APN type for MMS traffic. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_OEM_PAID` APN type for OEM_PAID networks (Automotive PANS) |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_OEM_PRIVATE` APN type for OEM_PRIVATE networks (Automotive PANS) |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_RCS` APN type for RCS (Rich Communication Services). |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_SUPL` APN type for SUPL assisted GPS. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_VSIM` APN type for VSIM. |
| `int` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_XCAP` APN type for XCAP. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that
the Parcelable object's flattened representation includes a file descriptor.


`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written
is a return value, that is the result of a function such as
"`Parcelable someFunction()`",
"`void someFunction(out Parcelable)`", or
"`void someFunction(inout Parcelable)`".


| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/telephony/data/ApnSetting>` | `https://developer.android.com/reference/android/telephony/data/ApnSetting#CREATOR` |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` boolean` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object o) ` Indicates whether some other object is "equal to" this one. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getApnName()() ` Returns the name of the APN. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getApnTypeBitmask()() ` Returns the bitmask of APN types. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getAuthType()() ` Returns the authentication type of the APN. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getCarrierId()() ` Returns the carrier id for this APN. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getEntryName()() ` Gets the human-readable name that describes the APN. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getId()() ` Returns the unique database id for this entry. |
| ` https://developer.android.com/reference/java/net/InetAddress` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getMmsProxyAddress()() ` *This method was deprecated in API level 29. use `https://developer.android.com/reference/android/telephony/data/ApnSetting#getMmsProxyAddressAsString()` instead.* |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getMmsProxyAddressAsString()() ` Returns the MMS proxy address of the APN. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getMmsProxyPort()() ` Returns the MMS proxy port of the APN. |
| ` https://developer.android.com/reference/android/net/Uri` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getMmsc()() ` Returns the MMSC Uri of the APN. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getMtuV4()() ` Returns the default MTU (Maximum Transmission Unit) size in bytes of the IPv4 routes brought up by this APN setting. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getMtuV6()() ` Returns the MTU size of the IPv6 mobile interface to which the APN connected. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getMvnoType()() ` Returns the MVNO match type for this APN. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getNetworkTypeBitmask()() ` Returns a bitmask describing the Radio Technologies (Network Types) which this APN may use. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getOperatorNumeric()() ` Returns the numeric operator ID for the APN. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getPassword()() ` Returns the APN password of the APN. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getProfileId()() ` Returns the profile id to which the APN saved in modem. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getProtocol()() ` Returns the protocol to use to connect to this APN. |
| ` https://developer.android.com/reference/java/net/InetAddress` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getProxyAddress()() ` *This method was deprecated in API level 29. use `https://developer.android.com/reference/android/telephony/data/ApnSetting#getProxyAddressAsString()` instead.* |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getProxyAddressAsString()() ` Returns the proxy address of the APN. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getProxyPort()() ` Returns the proxy address of the APN. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getRoamingProtocol()() ` Returns the protocol to use to connect to this APN while the device is roaming. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#getUser()() ` Returns the APN username of the APN. |
| ` int` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#hashCode()() ` Returns a hash code value for the object. |
| ` boolean` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#isAlwaysOn()() ` Returns whether User Plane resources have to be activated during every transition from CM-IDLE mode to CM-CONNECTED state for this APN See 3GPP TS 23.501 section 5.6.13 |
| ` boolean` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#isEnabled()() ` Returns the current status of APN. |
| ` boolean` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#isPersistent()() ` Returns if the APN setting is persistent on the modem. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#toString()() ` Returns the string representation of ApnSetting. |
| ` void` | ` https://developer.android.com/reference/android/telephony/data/ApnSetting#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


From interface `

https://developer.android.com/reference/android/os/Parcelable

` `
abstract


int` `
https://developer.android.com/reference/android/os/Parcelable#describeContents()()
`

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


`
abstract


void` `
https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags)
`

Flatten this object in to a Parcel.


## Constants

### AUTH_TYPE_CHAP

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int AUTH_TYPE_CHAP
```

Authentication type for CHAP.

<br />

Constant Value:

2
(0x00000002)


### AUTH_TYPE_NONE

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int AUTH_TYPE_NONE
```

Authentication is not required.

<br />

Constant Value:

0
(0x00000000)


### AUTH_TYPE_PAP

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int AUTH_TYPE_PAP
```

Authentication type for PAP.

<br />

Constant Value:

1
(0x00000001)


### AUTH_TYPE_PAP_OR_CHAP

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int AUTH_TYPE_PAP_OR_CHAP
```

Authentication type for PAP or CHAP.

<br />

Constant Value:

3
(0x00000003)


### MVNO_TYPE_GID

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int MVNO_TYPE_GID
```

MVNO type for group identifier level 1.

<br />

Constant Value:

2
(0x00000002)


### MVNO_TYPE_ICCID

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int MVNO_TYPE_ICCID
```

MVNO type for ICCID.

<br />

Constant Value:

3
(0x00000003)


### MVNO_TYPE_IMSI

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int MVNO_TYPE_IMSI
```

MVNO type for IMSI.

<br />

Constant Value:

1
(0x00000001)


### MVNO_TYPE_SPN

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int MVNO_TYPE_SPN
```

MVNO type for service provider name.

<br />

Constant Value:

0
(0x00000000)


### PROTOCOL_IP

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PROTOCOL_IP
```

Internet protocol.

<br />

Constant Value:

0
(0x00000000)


### PROTOCOL_IPV4V6

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PROTOCOL_IPV4V6
```

Virtual PDP type introduced to handle dual IP stack UE capability.

<br />

Constant Value:

2
(0x00000002)


### PROTOCOL_IPV6

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PROTOCOL_IPV6
```

Internet protocol, version 6.

<br />

Constant Value:

1
(0x00000001)


### PROTOCOL_NON_IP

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PROTOCOL_NON_IP
```

Transfer of Non-IP data to external packet data network.

<br />

Constant Value:

4
(0x00000004)


### PROTOCOL_PPP

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PROTOCOL_PPP
```

Point to point protocol.

<br />

Constant Value:

3
(0x00000003)


### PROTOCOL_UNSTRUCTURED

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PROTOCOL_UNSTRUCTURED
```

Transfer of Unstructured data to the Data Network via N6.

<br />

Constant Value:

5
(0x00000005)


### TYPE_BIP

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_BIP
```

APN type for BIP.

<br />

Constant Value:

8192
(0x00002000)


### TYPE_CBS

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_CBS
```

APN type for CBS.

<br />

Constant Value:

128
(0x00000080)


### TYPE_DEFAULT

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_DEFAULT
```

APN type for default data traffic.

<br />

Constant Value:

17
(0x00000011)


### TYPE_DUN

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_DUN
```

APN type for DUN traffic.

<br />

Constant Value:

8
(0x00000008)


### TYPE_EMERGENCY

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final 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.

<br />

Constant Value:

512
(0x00000200)


### TYPE_ENTERPRISE

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_ENTERPRISE
```

APN type for ENTERPRISE.

<br />

Constant Value:

16384
(0x00004000)


### TYPE_FOTA

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_FOTA
```

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

<br />

Constant Value:

32
(0x00000020)


### TYPE_HIPRI

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_HIPRI
```

APN type for HiPri traffic.

<br />

Constant Value:

16
(0x00000010)


### TYPE_IA

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_IA
```

APN type for IA Initial Attach APN.

<br />

Constant Value:

256
(0x00000100)


### TYPE_IMS

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_IMS
```

APN type for IMS.

<br />

Constant Value:

64
(0x00000040)


### TYPE_MCX

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_MCX
```

APN type for MCX (Mission Critical Service) where X can be PTT/Video/Data

<br />

Constant Value:

1024
(0x00000400)


### TYPE_MMS

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_MMS
```

APN type for MMS traffic.

<br />

Constant Value:

2
(0x00000002)


### TYPE_OEM_PAID

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_OEM_PAID
```

APN type for OEM_PAID networks (Automotive PANS)

<br />

Constant Value:

65536
(0x00010000)


### TYPE_OEM_PRIVATE

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_OEM_PRIVATE
```

APN type for OEM_PRIVATE networks (Automotive PANS)

<br />

Constant Value:

131072
(0x00020000)


### TYPE_RCS

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_RCS
```

APN type for RCS (Rich Communication Services).

<br />

Constant Value:

32768
(0x00008000)


### TYPE_SUPL

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_SUPL
```

APN type for SUPL assisted GPS.

<br />

Constant Value:

4
(0x00000004)


### TYPE_VSIM

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_VSIM
```

APN type for VSIM.

<br />

Constant Value:

4096
(0x00001000)


### TYPE_XCAP

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TYPE_XCAP
```

APN type for XCAP.

<br />

Constant Value:

2048
(0x00000800)


## Fields

### CREATOR

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<ApnSetting> CREATOR
```

<br />

<br />

## Public methods

### describeContents

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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 `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### equals

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean equals (Object o)
```

Indicates whether some other object is "equal to" this one.


The `equals` method implements an equivalence relation
on non-null object references:

- It is *reflexive*: for any non-null reference value `x`, `x.equals(x)` should return `true`.
- It is *symmetric*: for any non-null reference values `x` and `y`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`.
- It is *transitive*: for any non-null reference values `x`, `y`, and `z`, if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.
- It is *consistent*: for any non-null reference values `x` and `y`, multiple invocations of `x.equals(y)` consistently return `true` or consistently return `false`, provided no information used in `equals` comparisons on the objects is modified.
- For any non-null reference value `x`, `x.equals(null)` should return `false`.


An equivalence relation partitions the elements it operates on
into *equivalence classes*; all the members of an
equivalence class are equal to each other. Members of an
equivalence class are substitutable for each other, at least
for some purposes.

<br />

| Parameters ||
|---|---|
| `o` | `Object`: the reference object with which to compare. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### getApnName

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getApnName ()
```

Returns the name of the APN.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | APN name <br /> |

### getApnTypeBitmask

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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 `https://developer.android.com/reference/android/telephony/data/ApnSetting`.

<br />

| Returns ||
|---|---|
| `int` | a bitmask describing the types of the APN. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_DEFAULT` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_MMS` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_SUPL` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_DUN` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_HIPRI` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_FOTA` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_IMS` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_CBS` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_IA` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_EMERGENCY` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_MCX` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_XCAP` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_BIP` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_VSIM` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_ENTERPRISE` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_RCS` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_OEM_PAID` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#TYPE_OEM_PRIVATE` |

**See also:**

- `https://developer.android.com/reference/android/telephony/data/ApnSetting.Builder#setApnTypeBitmask(int)`

### getAuthType

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getAuthType ()
```

Returns the authentication type of the APN.

<br />

| Returns ||
|---|---|
| `int` | authentication type. Value is one of the following: - `https://developer.android.com/reference/android/telephony/data/ApnSetting#AUTH_TYPE_NONE` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#AUTH_TYPE_PAP` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#AUTH_TYPE_CHAP` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#AUTH_TYPE_PAP_OR_CHAP` |

### getCarrierId

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getCarrierId ()
```

Returns the carrier id for this APN.

<br />

| Returns ||
|---|---|
| `int` | the carrier id <br /> |

**See also:**

- `https://developer.android.com/reference/android/telephony/data/ApnSetting.Builder#setCarrierId(int)`

### getEntryName

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getEntryName ()
```

Gets the human-readable name that describes the APN.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the entry name for the APN <br /> |

### getId

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getId ()
```

Returns the unique database id for this entry.

<br />

| Returns ||
|---|---|
| `int` | the unique database id <br /> |

### getMmsProxyAddress

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InetAddress getMmsProxyAddress ()
```


**This method was deprecated
in API level 29.**   

use `https://developer.android.com/reference/android/telephony/data/ApnSetting#getMmsProxyAddressAsString()` instead.

Gets the MMS proxy address configured for the APN. The MMS proxy address might be an IP
address or hostname. This method returns `null` if system networking (typically DNS)
isn\\u2019t available to resolve a hostname value\\u2014values set as IP addresses don\\u2019t have this
restriction. This is a known problem and will be addressed in a future release.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/net/InetAddress` | the MMS proxy address or `null` if DNS isn\\u2019t available to resolve a hostname <br /> |

### getMmsProxyAddressAsString

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getMmsProxyAddressAsString ()
```

Returns the MMS proxy address of the APN.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | MMS proxy address. <br /> |

### getMmsProxyPort

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMmsProxyPort ()
```

Returns the MMS proxy port of the APN.

<br />

| Returns ||
|---|---|
| `int` | MMS proxy port <br /> |

### getMmsc

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Uri getMmsc ()
```

Returns the MMSC Uri of the APN.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/Uri` | MMSC Uri. <br /> |

### getMtuV4

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMtuV4 ()
```

Returns the default MTU (Maximum Transmission Unit) size in bytes of the IPv4 routes brought
up by this APN setting. Note this value will only be used when MTU size is not provided
in `DataCallResponse#getMtuV4()` during network bring up.

<br />

| Returns ||
|---|---|
| `int` | the MTU size in bytes of the route. <br /> |

### getMtuV6

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMtuV6 ()
```

Returns the MTU size of the IPv6 mobile interface to which the APN connected. Note this value
will only be used when MTU size is not provided in `DataCallResponse#getMtuV6()`
during network bring up.

<br />

| Returns ||
|---|---|
| `int` | the MTU size in bytes of the route. <br /> |

### getMvnoType

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getMvnoType ()
```

Returns the MVNO match type for this APN.

<br />

| Returns ||
|---|---|
| `int` | the MVNO match type. Value is one of the following: - `https://developer.android.com/reference/android/telephony/data/ApnSetting#MVNO_TYPE_SPN` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#MVNO_TYPE_IMSI` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#MVNO_TYPE_GID` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#MVNO_TYPE_ICCID` |

**See also:**

- `https://developer.android.com/reference/android/telephony/data/ApnSetting.Builder#setMvnoType(int)`

### getNetworkTypeBitmask

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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 `https://developer.android.com/reference/android/telephony/TelephonyManager`.

Examples of Network Types include `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_UNKNOWN`,
`https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_GPRS`, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_EDGE`.

<br />

| Returns ||
|---|---|
| `int` | a bitmask describing the Radio Technologies (Network Types) or 0 if it is undefined. <br /> |

### getOperatorNumeric

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getOperatorNumeric ()
```

Returns the numeric operator ID for the APN. Numeric operator ID is defined as
`https://developer.android.com/reference/android/provider/Telephony.Carriers#MCC` +
`https://developer.android.com/reference/android/provider/Telephony.Carriers#MNC`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the numeric operator ID <br /> |

### getPassword

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getPassword ()
```

Returns the APN password of the APN.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | APN password <br /> |

### getProfileId

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getProfileId ()
```

Returns the profile id to which the APN saved in modem.

<br />

| Returns ||
|---|---|
| `int` | the profile id of the APN <br /> |

### getProtocol

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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.

<br />

| Returns ||
|---|---|
| `int` | the protocol. Value is one of the following: - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_IP` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_IPV6` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_IPV4V6` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_PPP` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_NON_IP` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_UNSTRUCTURED` |

**See also:**

- `https://developer.android.com/reference/android/telephony/data/ApnSetting.Builder#setProtocol(int)`

### getProxyAddress

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InetAddress getProxyAddress ()
```


**This method was deprecated
in API level 29.**   

use `https://developer.android.com/reference/android/telephony/data/ApnSetting#getProxyAddressAsString()` instead.

Gets the HTTP proxy address configured for the APN. The proxy address might be an IP address
or hostname. This method returns `null` if system networking (typically DNS) isn\\u2019t
available to resolve a hostname value\\u2014values set as IP addresses don\\u2019t have this restriction.
This is a known problem and will be addressed in a future release.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/net/InetAddress` | the HTTP proxy address or `null` if DNS isn\\u2019t available to resolve a hostname <br /> |

### getProxyAddressAsString

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getProxyAddressAsString ()
```

Returns the proxy address of the APN.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | proxy address. <br /> |

### getProxyPort

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getProxyPort ()
```

Returns the proxy address of the APN.

<br />

| Returns ||
|---|---|
| `int` | proxy address. <br /> |

### getRoamingProtocol

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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.

<br />

| Returns ||
|---|---|
| `int` | the roaming protocol. Value is one of the following: - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_IP` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_IPV6` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_IPV4V6` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_PPP` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_NON_IP` - `https://developer.android.com/reference/android/telephony/data/ApnSetting#PROTOCOL_UNSTRUCTURED` |

**See also:**

- `https://developer.android.com/reference/android/telephony/data/ApnSetting.Builder#setRoamingProtocol(int)`

### getUser

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getUser ()
```

Returns the APN username of the APN.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | APN username <br /> |

### hashCode

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int hashCode ()
```

Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
`https://developer.android.com/reference/java/util/HashMap`.


The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### isAlwaysOn

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isAlwaysOn ()
```

Returns whether User Plane resources have to be activated during every transition from
CM-IDLE mode to CM-CONNECTED state for this APN
See 3GPP TS 23.501 section 5.6.13

<br />

| Returns ||
|---|---|
| `boolean` | True if the PDU session for this APN should always be on and false otherwise <br /> |

### isEnabled

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isEnabled ()
```

Returns the current status of APN.

`true` : enabled APN.
`false` : disabled APN.

<br />

| Returns ||
|---|---|
| `boolean` | the current status <br /> |

### isPersistent

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isPersistent ()
```

Returns if the APN setting is persistent on the modem.

<br />

| Returns ||
|---|---|
| `boolean` | `true` if the APN setting is persistent on the modem. <br /> |

### toString

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns the string representation of ApnSetting.

This method prints null for unset elements. The output doesn't contain password or user.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |