Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Carrier: -
Accepted Solution

network coverage info

how do we detect whether the device has network coverage or not?

 

the following QT code doesn't work:

manager->networkAccessible()==QNetworkAccessManager::NotAccessible

 

is there some BB10/Cascades specific API we should be using?

Please use plain text.
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Carrier: -

Re: network coverage info

been weeks, still can't find an API that says whether the device is IN COVERAGE or OUT OF COVERAGE...

 

no one solved this issue ??

Please use plain text.
Regular Contributor
i68040
Posts: 56
Registered: ‎02-05-2012
My Carrier: T-Mobile

Re: network coverage info

I'd be interested in a solution to this as well. Been trying to figure out how to detect the following internet access scenarios:

- Wifi Only available
- Wifi and Cellular available
- Cellular available

A couple of my apps would benefit from being able to switch between the connection that they use. A good first step would be figuring out if Internet "coverage" is available. :smileyhappy:
Please use plain text.
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Carrier: -

Re: network coverage info

got the answer from the bb10 developer relations team:

http://qt-project.org/doc/qt-4.8/qnetworkconfigurationmanager.html

Please use plain text.
Developer
ekke
Posts: 913
Registered: ‎04-08-2010
My Carrier: vodafone

Re: network coverage info

some sample code would be great ;-)

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: https://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Carrier: -

Re: network coverage info

the code is in the link i put . . .

 

bool QNetworkConfigurationManager::isOnline () const
Returns true if the system is considered to be connected to another device via an active network interface; otherwise returns false.
This is equivalent to the following code snippet:
 QNetworkConfigurationManager mgr;
 QList<QNetworkConfiguration> activeConfigs = mgr.allConfigurations(QNetworkConfiguration::Active)
 if (activeConfigs.count() > 0)
     Q_ASSERT(mgr.isOnline())
 else
     Q_ASSERT(!mgr.isOnline())

 

Please use plain text.
Developer
ekke
Posts: 913
Registered: ‎04-08-2010
My Carrier: vodafone

Re: network coverage info

thx - have seen this

 

was asking if someone has a real-world-sample:

automatic-detect-of-changing network coverage with slot/signals if wifi comes/goes and radio comes/goes

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: https://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Contributor
oddboy
Posts: 31
Registered: ‎05-24-2011
My Carrier: rogers

Re: network coverage info

using bps, you can get events delivered to you pertaining to network status.  using netstatus.h, you can also call netstatus_get_availability().

 

/**
* @brief Indicate whether the network is available
*
* The @c netstatus_get_availability() function indicates whether a network
* connection is available.
*
* @param is_available If @c true the network is available, if @c
* false the network is not available.
*
* @return @c BPS_SUCCESS upon success, @c BPS_FAILURE with @c errno set
* otherwise.
*/
BPS_API int netstatus_get_availability(bool *is_available);

 

you can determine which is default by asking for the default interface - netstatus_get_default_interface().

 

/**
* @brief Get the default interface
*
* The @c netstatus_get_default_interface() function gets the default interface.
*
* @param interface This will be populated with the default interface. May be
* NULL if there is no default interface. The caller must call @c bps_free()
* when done with this string.
*
* @return @c BPS_SUCCESS upon success, @c BPS_FAILURE with @c errno set
* otherwise.
*/
BPS_API int netstatus_get_default_interface(char **interface);

Please use plain text.