I am facing an issue when connecting to WiFi Network programmatically in Android Q.
I found two alternatives on google to achieve this :
- 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.
- 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?