Package android.net

Class NetworkInfo


  • public class NetworkInfo
    extends java.lang.Object
    Describes the status of a network interface.

    Use ConnectivityManager.getActiveNetworkInfo() to get an instance that represents the current network connection.

    • Constructor Summary

      Constructors 
      Constructor Description
      NetworkInfo()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isConnected()
      Indicates whether network connectivity exists and it is possible to establish connections and pass data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NetworkInfo

        public NetworkInfo()
    • Method Detail

      • 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.