The device in which the application will be will always be in the same place but in that same place there are many Wi-Fi networks.
Investigating I found that there is the class: WifiManager and its methods: WIFI_STATE_ENABLED, getConfiguredNetworks well I don't know if what I want to do can be done and I also have no idea where to start can someone tell me if it is possible or not?
UPDATE
Apparently what I mentioned above is possible. So far I can get it to connect to a Wi-Fi network it has previously been connected to with the following:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WifiManager wifiManager= (WifiManager)getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(true);
}
}
However, I don't know how to specify which Wi-Fi network it should connect to.
If you want to specify which Wi-Fi network we want our app to connect to, we can use the following code: