IT. Expert System.

Android Reference

NetworkInfo


android.net

Class NetworkInfo

    • Constructor Detail

      • NetworkInfo

        public NetworkInfo(int type)
        Deprecated.
        Parameters:
        type - network type
      • NetworkInfo

        public NetworkInfo(int type,
                   int subtype,
                   String typeName,
                   String subtypeName)
    • Method Detail

      • getSubtype

        public int getSubtype()
        Return a network-type-specific integer describing the subtype of the network.
        Returns:
        the network subtype
      • getTypeName

        public String getTypeName()
        Return a human-readable name describe the type of the network, for example "WIFI" or "MOBILE".
        Returns:
        the name of the network type
      • getSubtypeName

        public String getSubtypeName()
        Return a human-readable name describing the subtype of the network.
        Returns:
        the name of the network subtype
      • isConnectedOrConnecting

        public boolean isConnectedOrConnecting()
        Indicates whether network connectivity exists or is in the process of being established. This is good for applications that need to do anything related to the network other than read or write data. For the latter, call isConnected() instead, which guarantees that the network is fully usable.
        Returns:
        true if network connectivity exists or is in the process of being established, false otherwise.
      • isConnected

        public boolean isConnected()
        Indicates whether network connectivity exists and it is possible to establish connections and pass data.

        Always call this before attempting to perform data transactions.

        Returns:
        true if network connectivity exists, false otherwise.
      • isAvailable

        public boolean isAvailable()
        Indicates whether network connectivity is possible. A network is unavailable when a persistent or semi-persistent condition prevents the possibility of connecting to that network. Examples include
        • The device is out of the coverage area for any network of this type.
        • The device is on a network other than the home network (i.e., roaming), and data roaming has been disabled.
        • The device's radio is turned off, e.g., because airplane mode is enabled.
        Returns:
        true if the network is available, false otherwise
      • setIsAvailable

        public void setIsAvailable(boolean isAvailable)
        Sets if the network is available, ie, if the connectivity is possible.
        Parameters:
        isAvailable - the new availability value.
      • isFailover

        public boolean isFailover()
        Indicates whether the current attempt to connect to the network resulted from the ConnectivityManager trying to fail over to this network following a disconnect from another network.
        Returns:
        true if this is a failover attempt, false otherwise.
      • setFailover

        public void setFailover(boolean isFailover)
        Set the failover boolean.
        Parameters:
        isFailover - true to mark the current connection attempt as a failover.
      • isRoaming

        public boolean isRoaming()
        Indicates whether the device is currently roaming on this network. When true, it suggests that use of data on this network may incur extra costs.
        Returns:
        true if roaming is in effect, false otherwise.
      • getState

        public NetworkInfo.State getState()
        Reports the current coarse-grained state of the network.
        Returns:
        the coarse-grained state
      • getDetailedState

        public NetworkInfo.DetailedState getDetailedState()
        Reports the current fine-grained state of the network.
        Returns:
        the fine-grained state
      • setDetailedState

        public void setDetailedState(NetworkInfo.DetailedState detailedState,
                            String reason,
                            String extraInfo)
        Sets the fine-grained state of the network.
        Parameters:
        detailedState - the NetworkInfo.DetailedState.
        reason - a String indicating the reason for the state change, if one was supplied. May be null.
        extraInfo - an optional String providing addditional network state information passed up from the lower networking layers.
      • setExtraInfo

        public void setExtraInfo(String extraInfo)
        Set the extraInfo field.
        Parameters:
        extraInfo - an optional String providing addditional network state information passed up from the lower networking layers.
      • getReason

        public String getReason()
        Report the reason an attempt to establish connectivity failed, if one is available.
        Returns:
        the reason for failure, or null if not available
      • getExtraInfo

        public String getExtraInfo()
        Report the extra information about the network state, if any was provided by the lower networking layers., if one is available.
        Returns:
        the extra information, or null if not available
      • toString

        public String toString()
        Description copied from class: Object
        Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
           getClass().getName() + '@' + Integer.toHexString(hashCode())

        See Writing a useful toString method if you intend implementing your own toString method.

        Overrides:
        toString in class Object
        Returns:
        a printable representation of this object.
      • describeContents

        public int describeContents()
        Implement the Parcelable interface
        Specified by:
        describeContents in interface Parcelable
        Returns:
        a bitmask indicating the set of special object types marshalled by the Parcelable.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1771 / . Delta: 0.04024 с