Android Guides | Samples

Android.Net.NetworkInfo Class

Describes the status of a network interface.

See Also: NetworkInfo

Syntax

[Android.Runtime.Register("android/net/NetworkInfo", DoNotGenerateAcw=true)]
public class NetworkInfo : Object, IParcelable, IDisposable

Remarks

Describes the status of a network interface.

Use ConnectivityManager.ActiveNetworkInfo to get an instance that represents the current network connection.

[Android Documentation]

Requirements

Namespace: Android.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Net.NetworkInfo are listed below.

See Also: Object

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
ExtraInfoString. Report the extra information about the network state, if any was provided by the lower networking layers.
[read-only]
IsAvailableBoolean. Indicates whether network connectivity is possible.
[read-only]
IsConnectedBoolean. Indicates whether network connectivity exists and it is possible to establish connections and pass data.
[read-only]
IsConnectedOrConnectingBoolean. Indicates whether network connectivity exists or is in the process of being established.
[read-only]
IsFailoverBoolean. 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.
[read-only]
IsRoamingBoolean. Indicates whether the device is currently roaming on this network.
[read-only]
ReasonString. Report the reason an attempt to establish connectivity failed, if one is available.
[read-only]
SubtypeConnectivityType. Return a network-type-specific integer describing the subtype of the network.
[read-only]
SubtypeNameString. Return a human-readable name describing the subtype of the network.
[read-only]
TypeConnectivityType. Reports the type of network to which the info in this NetworkInfo pertains.
[read-only]
TypeNameString. Return a human-readable name describe the type of the network, for example "WIFI" or "MOBILE".

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

DescribeContents() : Int32
GetDetailedState() : NetworkInfo+DetailedState
Reports the current fine-grained state of the network.
GetState() : NetworkInfo+State
Reports the current coarse-grained state of the network.
WriteToParcel(Parcel, ParcelableWriteFlags)