I am developing an app for BB10 which requires to identify whether the device is connected to Internet or not. I am testing my app on the simulator and I am using the following code to test the connectivity.
QNetworkConfigurationManager netMgr;
QList<QNetworkConfiguration> mNetList = netMgr.allConfigurations( QNetworkConfiguration::Active);
if (mNetList.count() > 0)
{
if (netMgr.isOnline())
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
but every time I run this code, it gives me false
, whereas I am able to send any requests from the app to my server.
How can I test the Internet connectivity status using simulator ?