WifiConfiguration Class

Definition

A class representing a configured Wi-Fi network, including the security configuration.

[Android.Runtime.Register("android/net/wifi/WifiConfiguration", DoNotGenerateAcw=true)]
public class WifiConfiguration : Java.Lang.Object, Android.OS.IParcelable, IDisposable
[<Android.Runtime.Register("android/net/wifi/WifiConfiguration", DoNotGenerateAcw=true)>]
type WifiConfiguration = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
WifiConfiguration
Attributes
Implements

Remarks

A class representing a configured Wi-Fi network, including the security configuration.

Non privileged caller should use WifiNetworkSpecifier.Builder to create NetworkSpecifier and WifiNetworkSuggestion.Builder to create WifiNetworkSuggestion. This class can still be used with privileged APIs only such as WifiManager#addNetwork(WifiConfiguration).

Java documentation for android.net.wifi.WifiConfiguration.

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.

Constructors

Name Description
WifiConfiguration()
WifiConfiguration(IntPtr, JniHandleOwnership)

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

WifiConfiguration(WifiConfiguration)

Copy constructor

Fields

Name Description
RandomizationAuto

Let the wifi framework automatically decide the MAC randomization strategy.

RandomizationNone

Use factory MAC when connecting to this network

RandomizationNonPersistent

Use a randomly generated MAC address for connections to this network.

RandomizationPersistent

Generate a randomized MAC once and reuse it for all connections to this network

SecurityTypeDpp

Security type for Easy Connect (DPP) network

SecurityTypeEap

Security type for an EAP network.

SecurityTypeEapSuiteB

Security type for a WPA3-Enterprise in 192-bit security network.

SecurityTypeEapWpa3Enterprise

Security type for a WPA3-Enterprise network.

SecurityTypeEapWpa3Enterprise192Bit

Security type for a WPA3-Enterprise in 192-bit security network.

SecurityTypeOpen

Security type for an open network.

SecurityTypeOwe

Security type for an OWE network.

SecurityTypePsk

Security type for a PSK network.

SecurityTypeSae

Security type for an SAE network.

SecurityTypeWapiCert

Security type for a WAPI Certificate network.

SecurityTypeWapiPsk

Security type for a WAPI PSK network.

SecurityTypeWep

Security type for a WEP network.

Properties

Name Description
AllowedAuthAlgorithms

The set of authentication protocols supported by this configuration.

AllowedGroupCiphers

The set of group ciphers supported by this configuration.

AllowedGroupManagementCiphers

The set of group management ciphers supported by this configuration.

AllowedKeyManagement

The set of key management protocols supported by this configuration.

AllowedPairwiseCiphers

The set of pairwise ciphers for WPA supported by this configuration.

AllowedProtocols

The set of security protocols supported by this configuration.

AllowedSuiteBCiphers

The set of SuiteB ciphers supported by this configuration.

Bssid

When set, this network configuration entry should only be used when associating with the AP having the specified BSSID.

Class

Returns the runtime class of this Object.

(Inherited from Object)
EnterpriseConfig

The enterprise configuration details specifying the EAP method, certificates and other settings associated with the EAP.

Fqdn

Fully qualified domain name of a Passpoint configuration

Handle

The handle to the underlying Android instance.

(Inherited from Object)
HiddenSSID

This is a network that does not broadcast its SSID, so an SSID-specific probe request must be used for scans.

HttpProxy

Returns the HTTP proxy used by this object. -or- Set the ProxyInfo for this WifiConfiguration.

IsDppConfigurator

To check if this WifiConfiguration supports configuring a peer Enrollee device with SECURITY_TYPE_DPP

IsHomeProviderNetwork

Flag indicating if this network is provided by a home Passpoint provider or a roaming Passpoint provider.

IsPasspoint

Identify if this configuration represents a Passpoint network

JniIdentityHashCode

Gets the identity hash code assigned to this Java peer by the interop runtime.

(Inherited from Object)
JniManagedPeerState (Inherited from JavaObject)
JniPeerMembers
Key

Return a String that can be used to uniquely identify this WifiConfiguration.

MacRandomizationSetting

Get the MAC randomization setting for this network. -or- Set the MAC randomization setting for this network.

NetworkId

The ID number that the supplicant uses to identify this network configuration entry.

PeerReference

Gets the JNI object reference for this Java peer.

(Inherited from Object)
PreSharedKey

Pre-shared key for use with WPA-PSK.

Priority

Priority determines the preference given to a network by wpa_supplicant when choosing an access point with which to associate.

ProviderFriendlyName

Name of Passpoint credential provider

RandomizedMacAddress

Returns MAC address set to be the local randomized MAC address.

RoamingConsortiumIds

Roaming Consortium Id list for Passpoint credential; identifies a set of networks where Passpoint credential will be considered valid

Ssid

The network's SSID.

StatusField

The current status of this network configuration entry.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

WepKeys

Four WEP keys.

WepTxKeyIndex

Default WEP key index, ranging from 0 to 3.

Methods

Name Description
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Construct(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
DescribeContents()

Implement the Parcelable interface {

Dispose()

Releases the resources held by this Java peer.

(Inherited from Object)
Dispose(Boolean)

Releases the resources held by this Java peer.

(Inherited from Object)
DisposeUnlessReferenced() (Inherited from JavaObject)
Equals(Object) (Inherited from JavaObject)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetIpConfiguration(IpConfiguration)

Set the IpConfiguration for this network.

SetPeerReference(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
SetSecurityParams(Int32)

Set the various security params to correspond to the provided security type.

ToArray<T>()

Creates a managed array from this Java array wrapper.

(Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime()

Unregisters this Java peer from the interop runtime.

(Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WriteToParcel(Parcel, ParcelableWriteFlags)

Implement the Parcelable interface {

Explicit Interface Implementations

Name Description
IJavaPeerable.Disposed() (Inherited from JavaObject)
IJavaPeerable.Finalized() (Inherited from JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock (Inherited from JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from JavaObject)
IJavaPeerable.UnregisterFromRuntime()

Extension Methods

Name Description
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to