Android.Net Namespace

Provides APIs for managing Android network connectivity, addressing, sockets, and related networking features.

Classes

Name Description
CaptivePortal

A class allowing apps handling the ConnectivityManager#ACTION_CAPTIVE_PORTAL_SIGN_IN activity to indicate to the system different outcomes of captive portal sign in.

CaptivePortal.InterfaceConsts

Provides the constants that the Android CaptivePortal type inherits from the android.os.Parcelable interface.

ConnectivityDiagnosticsManager

Class that provides utilities for collecting network connectivity diagnostics information.

ConnectivityDiagnosticsManager.ConnectivityDiagnosticsCallback

Abstract base class for Connectivity Diagnostics callbacks.

ConnectivityDiagnosticsManager.ConnectivityReport

Class that includes connectivity information for a specific Network at a specific time.

ConnectivityDiagnosticsManager.ConnectivityReport.InterfaceConsts

Provides the constants that the Android ConnectivityDiagnosticsManager.ConnectivityReport type inherits from the android.os.Parcelable interface.

ConnectivityDiagnosticsManager.DataStallReport

Class that includes information for a suspected data stall on a specific Network

ConnectivityDiagnosticsManager.DataStallReport.InterfaceConsts

Provides the constants that the Android ConnectivityDiagnosticsManager.DataStallReport type inherits from the android.os.Parcelable interface.

ConnectivityManager

Class that answers queries about the state of network connectivity.

ConnectivityManager.NetworkCallback

Base class for NetworkRequest callbacks.

Credentials

A class for representing UNIX credentials passed via ancillary data on UNIX domain sockets.

DhcpInfo

A simple object for retrieving the results of a DHCP request.

DhcpInfo.InterfaceConsts

Provides the constants that the Android DhcpInfo type inherits from the android.os.Parcelable interface.

DnsResolver

Dns resolver class for asynchronous dns querying

DnsResolver.DnsException

Class to represent DNS error

EthernetNetworkSpecifier

A NetworkSpecifier used to identify ethernet interfaces.

EthernetNetworkSpecifier.InterfaceConsts

Provides the constants that the Android EthernetNetworkSpecifier type inherits from the android.os.Parcelable interface.

Ikev2VpnProfile

The Ikev2VpnProfile is a configuration for the platform setup of IKEv2/IPsec VPNs.

Ikev2VpnProfile.Builder

A incremental builder for IKEv2 VPN profiles

InetAddresses

Utility methods for InetAddress implementations.

IpConfiguration

A class representing the IP configuration of a network.

IpConfiguration.Builder

Builder used to construct IpConfiguration objects.

IpConfiguration.InterfaceConsts

Provides the constants that the Android IpConfiguration type inherits from the android.os.Parcelable interface.

IpPrefix

This class represents an IP prefix, i.e., a contiguous block of IP addresses aligned on a power of two boundary (also known as an "IP subnet").

IpPrefix.InterfaceConsts

Provides the constants that the Android IpPrefix type inherits from the android.os.Parcelable interface.

IpSecAlgorithm

This class represents a single algorithm that can be used by an IpSecTransform.

IpSecAlgorithm.InterfaceConsts

Provides the constants that the Android IpSecAlgorithm type inherits from the android.os.Parcelable interface.

IpSecManager

This class contains methods for managing IPsec sessions.

IpSecManager.ResourceUnavailableException

Thrown to indicate that an IPsec resource is unavailable.

IpSecManager.SecurityParameterIndex

This class represents a reserved SPI.

IpSecManager.SpiUnavailableException

Thrown to indicate that a requested SPI is in use.

IpSecManager.UdpEncapsulationSocket

This class provides access to a UDP encapsulation Socket.

IpSecTransform

This class represents a transform, which roughly corresponds to an IPsec Security Association.

IpSecTransform.Builder

This class is used to build IpSecTransform objects.

IpSecTransformState

This class represents a snapshot of the state of an IpSecTransform

IpSecTransformState.Builder

Builder class for testing purposes

IpSecTransformState.InterfaceConsts

Provides the constants that the Android IpSecTransformState type inherits from the android.os.Parcelable interface.

L2capNetworkSpecifier

A NetworkSpecifier used to identify an L2CAP network over BLE.

L2capNetworkSpecifier.Builder

A builder class for L2capNetworkSpecifier.

L2capNetworkSpecifier.InterfaceConsts

Provides the constants that the Android L2capNetworkSpecifier type inherits from the android.os.Parcelable interface.

LinkAddress

Identifies an IP address on a network link.

LinkAddress.InterfaceConsts

Provides the constants that the Android LinkAddress type inherits from the android.os.Parcelable interface.

LinkProperties

Describes the properties of a network link.

LinkProperties.InterfaceConsts

Provides the constants that the Android LinkProperties type inherits from the android.os.Parcelable interface.

LocalServerSocket

Non-standard class for creating an inbound UNIX-domain socket in the Linux abstract namespace.

LocalSocket

Creates a (non-server) socket in the UNIX-domain namespace.

LocalSocketAddress

A UNIX-domain (AF_LOCAL) socket address.

LocalSocketAddress.Namespace

The namespace that this address exists in.

MacAddress

Representation of a MAC address.

MacAddress.InterfaceConsts

Provides the constants that the Android MacAddress type inherits from the android.os.Parcelable interface.

MailTo

MailTo URL parser

Network

Identifies a Network.

Network.InterfaceConsts

Provides the constants that the Android Network type inherits from the android.os.Parcelable interface.

NetworkCapabilities

Representation of the capabilities of an active network.

NetworkCapabilities.InterfaceConsts

Provides the constants that the Android NetworkCapabilities type inherits from the android.os.Parcelable interface.

NetworkInfo

Describes the status of a network interface.

NetworkInfo.DetailedState

The fine-grained state of a network connection.

NetworkInfo.InterfaceConsts

Provides the constants that the Android NetworkInfo type inherits from the android.os.Parcelable interface.

NetworkInfo.State

Coarse-grained network state.

NetworkRequest

An object describing a network that the application is interested in.

NetworkRequest.Builder

Builder used to create NetworkRequest objects.

NetworkRequest.InterfaceConsts

Provides the constants that the Android NetworkRequest type inherits from the android.os.Parcelable interface.

NetworkSpecifier

Describes specific properties of a requested network for use in a NetworkRequest.

ParseException

Thrown when parsing failed.

PlatformVpnProfile

PlatformVpnProfile represents a configuration for a platform-based VPN implementation.

Proxy

A convenience class for accessing the user and default proxy settings.

ProxyInfo

Describes a proxy configuration.

ProxyInfo.InterfaceConsts

Provides the constants that the Android ProxyInfo type inherits from the android.os.Parcelable interface.

PskKeyManager

Provider of key material for pre-shared key (PSK) key exchange used in TLS-PSK cipher suites.

RouteInfo

Represents a network route.

RouteInfo.InterfaceConsts

Provides the constants that the Android RouteInfo type inherits from the android.os.Parcelable interface.

SocketKeepalive

Allows applications to request that the system periodically send specific packets on their behalf, using hardware offload to save battery power.

SocketKeepalive.Callback

The callback which app can use to learn the status changes of SocketKeepalive.

SSLCertificateSocketFactory

SSLSocketFactory implementation with several extra features:

        <ul>
        <li>Timeout specification for SSL handshake operations
        <li>Hostname verification in most cases (see WARNINGs below)
        &lt;li&gt;Optional SSL session caching with <code data-dev-comment-type="c">SSLSessionCache</code>&lt;li&gt;Optionally bypass all SSL certificate checks
        &lt;/ul&gt;

        The handshake timeout does not apply to actual TCP socket connection.
SSLSessionCache

File-based cache of established SSL sessions.

StaticIpConfiguration

Class that describes static IP configuration.

StaticIpConfiguration.Builder

Helper class to build a new instance of StaticIpConfiguration.

StaticIpConfiguration.InterfaceConsts

Provides the constants that the Android StaticIpConfiguration type inherits from the android.os.Parcelable interface.

TelephonyNetworkSpecifier

NetworkSpecifier object for cellular network request.

TelephonyNetworkSpecifier.Builder

Builder to create TelephonyNetworkSpecifier object.

TelephonyNetworkSpecifier.InterfaceConsts

Provides the constants that the Android TelephonyNetworkSpecifier type inherits from the android.os.Parcelable interface.

TetheringInterface

The mapping of tethering interface and type.

TetheringInterface.InterfaceConsts

Provides the constants that the Android TetheringInterface type inherits from the android.os.Parcelable interface.

TetheringManager

This class provides the APIs to control the tethering service.

TetheringManager.TetheringRequest

Use with #startTethering to specify additional parameters when starting tethering.

TetheringManager.TetheringRequest.Builder

Represents the Android TetheringManager.TetheringRequest.Builder API type.

TetheringManager.TetheringRequest.InterfaceConsts

Provides the constants that the Android TetheringManager.TetheringRequest type inherits from the android.os.Parcelable interface.

TrafficStats

Class that provides network traffic statistics.

Uri

Immutable URI reference.

Uri.Builder

Helper class for building or manipulating URI references.

Uri.InterfaceConsts

Provides the constants that the Android Uri type inherits from the android.os.Parcelable interface.

UrlQuerySanitizer

Sanitizes the Query portion of a URL.

UrlQuerySanitizer.IllegalCharacterValueSanitizer

Sanitize values based on which characters they contain.

UrlQuerySanitizer.ParameterValuePair

A simple tuple that holds parameter-value pairs.

VpnManager

This class provides an interface for apps to manage platform VPN profiles

VpnProfileState

Describe the state of VPN.

VpnProfileState.InterfaceConsts

Provides constants inherited from the Android VpnProfileState type.

VpnService

VpnService is a base class for applications to extend and build their own VPN solutions.

VpnService.Builder

Helper class to create a VPN interface.

Interfaces

Name Description
ConnectivityManager.IOnNetworkActiveListener

Callback for use with ConnectivityManager#addDefaultNetworkActiveListener to find out when the system default network has gone in to a high power state.

DnsResolver.ICallback

Base interface for answer callbacks

ITransportInfo

A container for transport-specific capabilities which is returned by NetworkCapabilities#getTransportInfo().

TetheringManager.IStartTetheringCallback

Callback for use with #startTethering to find out whether tethering succeeded.

TetheringManager.IStopTetheringCallback

Callback for use with #stopTethering to find out whether stop tethering succeeded.

TetheringManager.ITetheringEventCallback

Callback for use with registerTetheringEventCallback to find out tethering upstream status.

UrlQuerySanitizer.IValueSanitizer

A functor used to sanitize a single query value.

Enums

Name Description
ConnectivityType

Enumerates values returned by several types and taken as a parameter of several methods of ConnectivityManager.

DataStallDetectionMethod

Defines values that correspond to the Android ConnectivityDiagnosticsManager.DataStallReport.DETECTION_METHOD_* constants.

DnsResolverFlag

Defines values that correspond to the Android DnsResolver.FLAG_* constants.

DnsResolverType

Defines values that correspond to the Android DnsResolver.TYPE_* constants.

ErrorCode

Defines values that correspond to the Android SocketKeepalive.ERROR_* constants.

IllegalCharacterFlags

Enumerates values returned by several methods of IllegalCharacterFlags and taken as a parameter of the F:Android.Net.UrlQuerySanitizer+IllegalCharacterValueSanitizer..ctor member.

IpSecTransportDirection

Defines values that correspond to the Android IpSecManager.DIRECTION_* constants.

L2capNetworkSpecifierHeaderCompression

Defines values that correspond to the Android L2capNetworkSpecifier.HEADER_COMPRESSION_* constants.

L2capNetworkSpecifierRole

Defines values that correspond to the Android L2capNetworkSpecifier.ROLE_* constants.

MacAddressType

Defines values that correspond to the Android MacAddress.TYPE_* constants.

MultipathPreference

Defines values that correspond to the Android ConnectivityManager.MULTIPATH_PREFERENCE_* constants.

NetCapability

Defines values that correspond to the Android NetworkCapabilities.NET_CAPABILITY_* constants.

NetEnterpriseId

Defines values that correspond to the Android NetworkCapabilities.NET_ENTERPRISE_ID_* constants.

NetworkCallbackFlags

Defines values that correspond to the Android ConnectivityManager.NetworkCallback.FLAG_* constants.

NetworkProbeType

Defines values that correspond to the Android ConnectivityDiagnosticsManager.ConnectivityReport.NETWORK_PROBE_* constants.

NetworkValidationResult

Defines values that correspond to the Android ConnectivityDiagnosticsManager.ConnectivityReport.NETWORK_VALIDATION_RESULT_* constants.

PlatformVpnProfileType

Defines values that correspond to the Android PlatformVpnProfile.TYPE_IKEV2_IPSEC_* constants.

RestrictBackgroundStatus

Defines values that correspond to the Android ConnectivityManager.RESTRICT_BACKGROUND_STATUS_* constants.

RouteType

Defines values that correspond to the Android RouteInfo.RTN_* constants.

SocketType

Enumerates values returned by several types and taken as a parameter of the F:Android.Net.LocalSocket..ctor member.

TetheringManagerConnectivityScope

Defines a value that corresponds to the Android TetheringManager.CONNECTIVITY_SCOPE_GLOBAL constant.

TetheringManagerTetherError

Defines values that correspond to the Android TetheringManager.TETHER_ERROR_* constants.

TetheringManagerTetheringType

Defines a value that corresponds to the Android TetheringManager.TETHERING_WIFI constant.

TransportType

Defines values that correspond to the Android NetworkCapabilities.TRANSPORT_* constants.

VpnErrorClass

Defines values that correspond to the Android VpnManager.ERROR_CLASS_* constants.

VpnErrorCode

Defines values that correspond to the Android VpnManager.ERROR_CODE_NETWORK_* constants.

VpnState

Defines values used by the Android VpnState API.

WifiMode

Enumerates values returned by the Full, FullHighPerf, and ScanOnly members and taken as a parameter of the F:Android.Net.Wifi.WifiManager.CreateWifiLock member.

WifiState

Enumerates values returned by several types.

Remarks

Java documentation for the android.net package.