Skip to content

Most visited

Recently visited

added in API level 1

Classes that help with network access, beyond the normal* APIs.


ConnectivityManager.OnNetworkActiveListener Callback for use with addDefaultNetworkActiveListener(ConnectivityManager.OnNetworkActiveListener) to find out when the system default network has gone in to a high power state. 
UrlQuerySanitizer.ValueSanitizer A functor used to sanitize a single query value. 


CaptivePortal A class allowing apps handling the ACTION_CAPTIVE_PORTAL_SIGN_IN activity to indicate to the system different outcomes of captive portal sign in. 
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. 
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"). 
IpSecAlgorithm This class represents a single algorithm that can be used by an IpSecTransform
IpSecManager This class contains methods for managing IPsec sessions. 
IpSecManager.SecurityParameterIndex This class represents a reserved SPI. 
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. 
LinkAddress Identifies an IP address on a network link. 
LinkProperties Describes the properties of a network link. 
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. 
MacAddress Representation of a MAC address. 
MailTo MailTo URL parser This class parses a mailto scheme URL and then can be queried for the parsed parameters. 
Network Identifies a Network
NetworkCapabilities Representation of the capabilities of an active network. 
NetworkInfo Describes the status of a network interface. 
NetworkRequest Defines a request for a network, made through NetworkRequest.Builder and used to request a network via requestNetwork(NetworkRequest, PendingIntent) or listen for changes via registerNetworkCallback(NetworkRequest, PendingIntent)
NetworkRequest.Builder Builder used to create NetworkRequest objects. 
NetworkSpecifier Describes specific properties of a network for use in a NetworkRequest
Proxy A convenience class for accessing the user and default proxy settings. 
ProxyInfo Describes a proxy configuration. 
RouteInfo Represents a network route. 
SSLCertificateSocketFactory SSLSocketFactory implementation with several extra features:
  • Timeout specification for SSL handshake operations
  • Hostname verification in most cases (see WARNINGs below)
  • Optional SSL session caching with SSLSessionCache
  • Optionally bypass all SSL certificate checks
The handshake timeout does not apply to actual TCP socket connection. 
SSLSessionCache File-based cache of established SSL sessions. 
TrafficStats Class that provides network traffic statistics. 
Uri Immutable URI reference. 
Uri.Builder Helper class for building or manipulating URI references. 
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. 
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. 


LocalSocketAddress.Namespace The namespace that this address exists in. 
NetworkInfo.DetailedState The fine-grained state of a network connection. 
NetworkInfo.State Coarse-grained network state. 


IpSecManager.ResourceUnavailableException Thrown to indicate that an IPsec resource is unavailable. 
IpSecManager.SpiUnavailableException Thrown to indicate that a requested SPI is in use. 
ParseException Thrown when parsing a URL fails. 
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)