×
Namespaces

Variants
Actions

Create network Session without user interaction

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Compatibility
Platform(s):
Symbian
Article
Created: talk2mks (09 Apr 2011)
Last edited: hamishwillee (11 Oct 2012)

Sometime we have required to configure network bearer according to use. We can manage the network configurations by use of QNetworkConfigurationManager. Here is a simple code to do this.

QNetworkConfigurationManager conf;
const bool isAccessPoint = (conf.capabilities() & QNetworkConfigurationManager::BearerManagement );
 
QNetworkConfiguration netConf = conf.defaultConfiguration();
 
if(netConf.isValid() || !isAccessPoint)
return;
 
switch (netconf.type()) {
 
case QNetworkConfiguration::InternetAccessPoint:
// System start the IAP immediately
break;
case QNetworkConfiguration::ServiceNetwork:
// System determines the best IAP available and starts it immediately
break;
case QNetworkConfiguration::UserChoice:
//the AP is resolved by asking the user
break;
case QNetworkConfiguration::Invalid:
//Invalid IAP
break;
}
 
QNetworkSession* sess = new QNetworkSession (netConf);
sess->open();
This page was last modified on 11 October 2012, at 04:16.
52 page views in the last 30 days.
×