[solved] How to detect connected via WiFi?
-
How can I detect, from QML, if the phone is connected via WiFi? (I need to allow the user to do different things when connected to WiFi) If not possible, how can this be done from Qt c++?
Thanks
Simon
-
I guess you have to do it from C++. You can watch the QNetworkConfiguration class which has a bearerType.
-
Answering my own question...
Use import QtMobility.systeminfo 1.1 and NetworkInfo
Documented here http://doc.qt.nokia.com/qtmobility-1.2/systeminfo.html for Mobility 1.2 but it's in 1.1 as well.Simon
-
Further testing has shown that while the QML API is there, it doesn't work on the phone (Symbian^3) under Mobility 1.1.
Simon
-
The Nokia QT SDK 1.0 contains QT 4.6. For QML you'll need the Nokia QT SDK 1.1 preview:
http://labs.qt.nokia.com/2011/01/20/qt-sdk-1-1-technology-preview-released/
or manually install the Symbian SDK and QT 4.7 for Symbian.
-
Thanks tomjanssens for the post but the testing I did was with Nokia Qt SDK 1.1 Tech preview and with the tech preview mobility sis installed.
Simon
-
I haven't tried the preview yet. I installed the Symbian SDK and the QT 4.7.1 for Symbian^3 which works fine for me. However, it seems that you can no longer download QT 4.7.1 for Symbian^3 (as mentioned here: http://wiki.forum.nokia.com/index.php/Qt_4.7_for_Symbian^3_-_developer_version).
-
Hmm tried to play with this one recently and problem is that the NetworkInfo.networkStatus is deemed "Undefined" for the application.
If I play around with the Simulator and edit Network Properties manually - I can get it work (like I am making the mode Connected manually), but how this NetworkStatus is supposed to tell my app what really status the underlying system has (in my case my N8 phone...)