0

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 ?

Mayank
  • 1,099
  • 4
  • 17
  • 44

1 Answers1

0

I has a similiar question some time ago. Not really the same, as I did this using Air for BB10, but you should get an idea of what to do.

You can check it here: How to detect network in Blackberry 10 Dev Alpha Simulator using qnx.net.NetworkManager on Air SDK

TL;DR

VMWare will not give you an acccurate Network status, but SDK methods SHOULD work as expected in real devices.

Community
  • 1
  • 1
Hugo A
  • 413
  • 2
  • 6
  • 23