Last active
October 27, 2018 23:14
-
-
Save tiwiz/4bf5c14519eb23ad3b228d6da484a295 to your computer and use it in GitHub Desktop.
Add your Wi-Fi Network to Android Things
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String networkSSID = "Your Network SSID here"; | |
String networkPasskey = "YourNetworkPasswordHere"; | |
WifiConfiguration wifiConfiguration = new WifiConfiguration(); | |
wifiConfiguration.SSID = "\"" + networkSSID + "\""; | |
wifiConfiguration.preSharedKey = "\"" + networkPasskey + "\""; | |
WifiManager manager = (WifiManager) getSystemService(WIFI_SERVICE); | |
manager.addNetwork(wifiConfiguration); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment