public static final class

WifiProfile.Builder

extends Object
java.lang.Object
   ↳ com.datalogic.device.wifi.WifiProfile.Builder

Class Overview

The WifiProfile.Builder class is used create and manipulate Wi-Fi profiles.

Summary

Public Methods
WifiProfile build()
Creates a WifiProfile with the configuration supplied to this builder.
WifiProfile.Builder hasHiddenEssid(boolean isHiddenSsid)
Sets the Wi-Fi profile hidden state.
WifiProfile.Builder hasPriority(int priority)
Sets the Wi-Fi profile priority for associating.
WifiProfile.Builder withAutomaticProxy(Uri pacUri)
Sets the Wi-Fi profile to use a PAC-based automatic proxy.
WifiProfile.Builder withCaCertificate(String caCertificate)
Sets the Wi-Fi profile CA certificate.
WifiProfile.Builder withDhcp()
Sets the Wi-Fi profile to used a dynamically-assigned IP address.
WifiProfile.Builder withIpAddress(String ipAddress, int prefixLength, String gateway, String[] domainNameServers)
Sets the Wi-Fi profile to used a manually-assigned static IP address.
WifiProfile.Builder withIpAddress(String ipAddress, int prefixLength, String gateway)
Sets the Wi-Fi profile to used a manually-assigned static IP address.
WifiProfile.Builder withManualProxy(String host, int port)
Sets the Wi-Fi profile to use a manually-configured static proxy.
WifiProfile.Builder withManualProxy(String host, int port, String[] exclusionList)
Sets the Wi-Fi profile to use a manually-configured static proxy.
WifiProfile.Builder withNoProxy()
Sets the Wi-Fi profile not to use proxy.
WifiProfile.Builder withOpen()
Sets the Wi-Fi profile to use an OPEN authentication scheme.
WifiProfile.Builder withUserCertificate(WifiProfile.CertificateType userCertificateType, String userCertificate, String userCertificatePassword)
Sets the Wi-Fi profile user certificate.
WifiProfile.Builder withWep104(String key)
Sets the Wi-Fi profile to use an WEP-104 authentication scheme.
WifiProfile.Builder withWep40(String key)
Sets the Wi-Fi profile to use an WEP-40 authentication scheme.
WifiProfile.Builder withWpaEap(WifiProfile.EapMethod method, WifiProfile.EapPhase2 phase2, String identity, String anonymousIdentity, String password)
Sets the Wi-Fi profile to use an WPA-EAP/WPA2-EAP authentication scheme.
WifiProfile.Builder withWpaPsk(String passphrase)
Sets the Wi-Fi profile to use an WPA-PSK/WPA2-PSK authentication scheme.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public WifiProfile build ()

Added in revision 32

Creates a WifiProfile with the configuration supplied to this builder.

public WifiProfile.Builder hasHiddenEssid (boolean isHiddenSsid)

Added in revision 32

Sets the Wi-Fi profile hidden state. This is a clue for the Wi-Fi supplicant in when the ESSID is hidden from the Wi-Fi infrastructure beacons.

Parameters
isHiddenSsid whether profile ESSID is hidden or not.
Returns

public WifiProfile.Builder hasPriority (int priority)

Added in revision 32

Sets the Wi-Fi profile priority for associating.

Parameters
priority the priority to be assigned to the Wi-Fi profile.
Returns

public WifiProfile.Builder withAutomaticProxy (Uri pacUri)

Added in revision 32

Sets the Wi-Fi profile to use a PAC-based automatic proxy.

Parameters
pacUri URI from whence the PAC script will be downloaded and runt.
Returns

public WifiProfile.Builder withCaCertificate (String caCertificate)

Added in revision 32

Sets the Wi-Fi profile CA certificate. Note: calling this method could be necessary for certain WifiProfile.EapMethod types.

Parameters
caCertificate String representation of the X.509 certificate to be used for the authentication.
Returns

public WifiProfile.Builder withDhcp ()

Added in revision 32

Sets the Wi-Fi profile to used a dynamically-assigned IP address.

Returns

public WifiProfile.Builder withIpAddress (String ipAddress, int prefixLength, String gateway, String[] domainNameServers)

Added in revision 32

Sets the Wi-Fi profile to used a manually-assigned static IP address.

Parameters
ipAddress IP Address to be assigned to the device.
prefixLength IP netmask in form of prefix-length (from 1 to 32).
gateway Default gateway to access the Internet.
domainNameServers Domain name servers to be used for name resolution.
Returns

public WifiProfile.Builder withIpAddress (String ipAddress, int prefixLength, String gateway)

Added in revision 32

Sets the Wi-Fi profile to used a manually-assigned static IP address. Google's DNSes will be used for name resolution.

Parameters
ipAddress IP Address to be assigned to the device.
prefixLength IP netmask in form of prefix-length (from 1 to 32).
gateway Default gateway to access the Internet.
Returns

public WifiProfile.Builder withManualProxy (String host, int port)

Added in revision 32

Sets the Wi-Fi profile to use a manually-configured static proxy.

Parameters
host Address of the host to be used as proxy.
port Port of the host to be used as proxy.
Returns

public WifiProfile.Builder withManualProxy (String host, int port, String[] exclusionList)

Added in revision 32

Sets the Wi-Fi profile to use a manually-configured static proxy.

Parameters
host Address of the host to be used as proxy.
port Port of the host to be used as proxy.
exclusionList Hosts to exclude using the proxy on connections for. These hosts can use wildcards such as *.example.com..
Returns

public WifiProfile.Builder withNoProxy ()

Added in revision 32

Sets the Wi-Fi profile not to use proxy.

Returns

public WifiProfile.Builder withOpen ()

Added in revision 32

Sets the Wi-Fi profile to use an OPEN authentication scheme.

Returns

public WifiProfile.Builder withUserCertificate (WifiProfile.CertificateType userCertificateType, String userCertificate, String userCertificatePassword)

Added in revision 32

Sets the Wi-Fi profile user certificate. Note: calling this method could be necessary for certain WifiProfile.EapMethod types.

Parameters
userCertificateType WifiProfile.CertificateType type of user certificate.
userCertificate String representation or alias of the X.509 certificate to be used for the authentication.
userCertificatePassword Password to access the keystore holding the certificate.
Returns

public WifiProfile.Builder withWep104 (String key)

Added in revision 32

Sets the Wi-Fi profile to use an WEP-104 authentication scheme.

Parameters
key the 104-bit key to be used for authentication, as a 26 character-long hex string, or generic passphrase.
Returns

public WifiProfile.Builder withWep40 (String key)

Added in revision 32

Sets the Wi-Fi profile to use an WEP-40 authentication scheme.

Parameters
key the 40-bit key to be used for authentication, as a 10 character-long hex string, or generic passphrase.
Returns

public WifiProfile.Builder withWpaEap (WifiProfile.EapMethod method, WifiProfile.EapPhase2 phase2, String identity, String anonymousIdentity, String password)

Added in revision 32

Sets the Wi-Fi profile to use an WPA-EAP/WPA2-EAP authentication scheme.

Parameters
method WifiProfile.EapMethod EAP method to be used for authentication.
phase2 WifiProfile.EapPhase2 EAP phase-2 method to be used for authentication.
identity EAP identity.
anonymousIdentity EAP anonymous identity. This is used as the unencrypted identity with certain WifiProfile.EapMethod types.
password EAP identify password.
Returns

public WifiProfile.Builder withWpaPsk (String passphrase)

Added in revision 32

Sets the Wi-Fi profile to use an WPA-PSK/WPA2-PSK authentication scheme.

Parameters
passphrase the 256-bit key to be used for authentication, as a 64 character-long hex string, or generic passphrase.
Returns