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.

inside custom component

Native Development

Reply
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha
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?

Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha

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 ??

Developer
i68040
Posts: 59
Registered: ‎02-05-2012
My Device: Q10

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:
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha

Re: network coverage info

got the answer from the bb10 developer relations team:

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

Developer
ekke
Posts: 1,561
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: network coverage info

some sample code would be great ;-)

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

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

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha

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())

 

Developer
ekke
Posts: 1,561
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, 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
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
oddboy
Posts: 136
Registered: ‎05-24-2011
My Device: Z30 running 10.2 and Playbook 4GLTE running OS2.1

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);

bron: a cron-like scheduler for BlackBerry 10
http://apps.oddelement.com