Unsolved Detecting WiFi network
-
Did you solve this issue using native APIs ?
-
Hi sir @dheerendra
sorry for late reply..
I didn't tried with native APIs.
But when I am trying the above code with Android device I am getting this output
CODE:QStringList WiFisList; QNetworkConfiguration cfg; QNetworkConfigurationManager ncm; auto nc = ncm.allConfigurations(); for (auto &x : nc) { qDebug()<< "CHECK1 " << x.bearerType(); if (x.bearerType() == QNetworkConfiguration::BearerWLAN) { qDebug ()<<"CHECK2"; qDebug() <<"WIFI is"<<x.name(); }
OUTPUT:
D libWiFi.so: ..\AshishTest\main.cpp:19 (int main(int, char**)): CHECK1 1 D libWiFi.so: ..\AshishTest\main.cpp:19 (int main(int, char**)): CHECK1 2 D libWiFi.so: ..\AshishTest\main.cpp:21 (int main(int, char**)): CHECK2 D libWiFi.so: ..\AshishTest\main.cpp:22 (int main(int, char**)): WIFI is "Mobile" D libWiFi.so: ..\AshishTest\main.cpp:19 (int main(int, char**)): CHECK1 2 D libWiFi.so: ..\AshishTest\main.cpp:21 (int main(int, char**)): CHECK2 D libWiFi.so: ..\AshishTest\main.cpp:22 (int main(int, char**)): WIFI is "WiFi" D libWiFi.so: ..\AshishTest\main.cpp:19 (int main(int, char**)): CHECK1 7
For android device it is entering inside if (x.bearerType() == QNetworkConfiguration::BearerWLAN) as it is printing check2.
just the problem is that output is WIFI is "WiFi" instead of wifi name I am getting "WiFi" as output . Is something missing in my code? -
This post is deleted! -
Seems i am having also same issue .
when i am printing x.bearerTypename i am having the name of interface only.
not getting all SSID names in the list.
can anyone help me here. -
@Mohan1997
On Android is not support, you need to implement it with AndroidExtras and calling directly java class