ConnectivityManager.GetNetworkInfo Method

Definition

Overloads

GetNetworkInfo(ConnectivityType)

Returns connection status information about a particular network type.

GetNetworkInfo(Network)

Returns connection status information about a particular Network.

GetNetworkInfo(ConnectivityType)

Returns connection status information about a particular network type.

[Android.Runtime.Register("getNetworkInfo", "(I)Landroid/net/NetworkInfo;", "GetGetNetworkInfo_IHandler")]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")]
public virtual Android.Net.NetworkInfo? GetNetworkInfo (Android.Net.ConnectivityType networkType);
[<Android.Runtime.Register("getNetworkInfo", "(I)Landroid/net/NetworkInfo;", "GetGetNetworkInfo_IHandler")>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")>]
abstract member GetNetworkInfo : Android.Net.ConnectivityType -> Android.Net.NetworkInfo
override this.GetNetworkInfo : Android.Net.ConnectivityType -> Android.Net.NetworkInfo

Parameters

networkType
ConnectivityType

integer specifying which networkType in which you're interested.

Returns

a NetworkInfo object for the requested network type or null if the type is not supported by the device. If networkType is TYPE_VPN and a VPN is active for the calling app, then this method will try to return one of the underlying networks for the VPN or null if the VPN agent didn't specify any.

Attributes

Remarks

Returns connection status information about a particular network type.

This member is deprecated. This method does not support multiple connected networks of the same type. Use #getAllNetworks and #getNetworkInfo(android.net.Network) instead.

Java documentation for android.net.ConnectivityManager.getNetworkInfo(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

GetNetworkInfo(Network)

Returns connection status information about a particular Network.

[Android.Runtime.Register("getNetworkInfo", "(Landroid/net/Network;)Landroid/net/NetworkInfo;", "GetGetNetworkInfo_Landroid_net_Network_Handler")]
[Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")]
public virtual Android.Net.NetworkInfo? GetNetworkInfo (Android.Net.Network? network);
[<Android.Runtime.Register("getNetworkInfo", "(Landroid/net/Network;)Landroid/net/NetworkInfo;", "GetGetNetworkInfo_Landroid_net_Network_Handler")>]
[<Android.Runtime.RequiresPermission("android.permission.ACCESS_NETWORK_STATE")>]
abstract member GetNetworkInfo : Android.Net.Network -> Android.Net.NetworkInfo
override this.GetNetworkInfo : Android.Net.Network -> Android.Net.NetworkInfo

Parameters

network
Network

Network specifying which network in which you're interested.

Returns

a NetworkInfo object for the requested network or null if the Network is not valid.

Attributes

Remarks

Returns connection status information about a particular Network.

This member is deprecated. See NetworkInfo.

Java documentation for android.net.ConnectivityManager.getNetworkInfo(android.net.Network).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to