After you have installed the Android Things OS on your Raspberry board or Intel Edison, we can configure the WiFi connection. This can be done using the adb shell. Open a terminal window or a command prompt and write the following:
adb shell am startservice -n com.google.wifisetup/.WifiSetupService -a WifiSetupService.Connect -e ssid <Your_WIFI_SSID> -e passphrase <WIFI_password>
Where Your_WIFI_SSID is the ID of your WIFI and WIFI_password is the password you use to connect to your WiFi.