Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blackberry 10 cascades - Check Internet connectivity

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?

like image 743
Vendetta Avatar asked Nov 26 '12 12:11

Vendetta


2 Answers

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());
}
like image 125
SelvaRaman Avatar answered Oct 04 '22 15:10

SelvaRaman


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

like image 40
Dielson Sales Avatar answered Oct 04 '22 17:10

Dielson Sales