I am developing an application for BB-10 using web service. In this I want to parse JSON in both the get and post methods and I want to check the Internet availability.
How can I do this?
Check the Internet Availability using the below code
bool app::isNetworkAvailable() {
QNetworkConfigurationManager netMgr;
QList<QNetworkConfiguration> mNetList = netMgr.allConfigurations(QNetworkConfiguration::Active);
return (mNetList.count() > 0 && netMgr.isOnline());
}
My teacher created a qml component that shows if there is connection and what kind of connection it is (wifi, bluetooth, carrier etc). It also sends a signal when the connection status or the interface used has changed.
The code is hosted at github: https://github.com/rodrigopex/CheckInternetMicroSample
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With