Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Create network Session without user interaction

From 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 01:16.
69 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×