Connecting to WiFi Programmatically in Android Q

256 Views Asked by At

I am facing an issue when connecting to WiFi Network programmatically in Android Q.

I found two alternatives on google to achieve this :

  1. NetworkSuggestions
  • It requires user to forget the network first.
  • List item
  • If user disconnects the network from settings then this network will not be available for next 24 hours.
  • Also, I found that this API has different behaviour on different Android devices.
  1. NetworkSpecifier
  • It doesn’t have any internet connectivity.

But, these APIs doesn’t support the previous versions of Android( below API 29 ).

Is there any other way to achieve WiFi connection programmatically?

0

There are 0 best solutions below