Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QNetworkConfigurationManager in Android
I'm developing a Qt application in my Android phone and I'm using QNetworkConfigurationManager to find the existing configuration (like scan for available wifi networks). When I run the application on Desktop it works fine (it returns all the available configurations, wlan0 and eth0), however when I deploy it on my Android phone it seems that it cannot find the available configurations except "wlan0".
More specifically this line of code:
const bool canStartIAP = (manager.capabilities()
gets the value "true" on Desktop and "false" on Android.
Am I missing something? Should I add anything to the .pro file except for QT+=network ?
bq. when I deploy it on my Android phone it seems that it cannot find the available configurations except “wlan0”.
Does your Android phone have other interfaces like for eg. eth0 i.e a LAN port ?
No, I do not think that it has. It is connected to WiFi when I deploy the application and that's why I thought it only finds wlan0.
If it has WiFi then it will be wlan0. Now does your application detect wlan0 ?
The thing is it always detects wlan0.
I want it to detect all available networks in the area and it doesn't...
Well you are asking for the available networks and not interfaces. I'm not sure if it works. If it doesn't another way would be to use QAndroidExtras to execute the Android specific Java API's for WiFi network scanning. For eg. "this":http://www.androidsnippets.com/scan-for-wireless-networks
Yes I have it in mind.
I was planning to use QNetworkConfigurationManager to see available networks, put them in a ListWidget, and use QAndroidExtras to connect to a specific network, the one the user chooses from the list.
Anyway, thank you very much for your reply!
I will search more to see if I will find a solution!