Skip to content

NDefWifiCreator

com.rvi.application.creator.NDefWifiCreator · Class · SocialCard 1.0.3

Build a Wi-Fi credential record for an open or WPA2-Personal network.

For WPA2-Personal, supply the SSID and password to use the default authentication and encryption. For an open network, select both OPEN and NONE and leave the password unset.

final NDefWifi guest = new NDefWifiCreator()
.ssid("Guest")
.authentication(WifiAuthentication.OPEN)
.encryption(WifiEncryption.NONE)
.build();
System.out.println(guest.ssid());
Java imports
import com.rvi.application.creator.NDefWifiCreator;
import com.rvi.domain.NDefWifi;
import com.rvi.domain.WifiAuthentication;
import com.rvi.domain.WifiEncryption;

Use separate builders for separate networks to avoid carrying over the credentials of a previous build.

The default settings are WPA2_PERSONAL with AES. The builder constructs NDefWifi when build() is called, and that record checks SSID size, settings and password together.

NDefWifi · WifiAuthentication · WifiEncryption · NDefValueException

Method signatures in the Javadoc · All API types