12-09-2012 05:24 AM
how do we detect whether the device has network coverage or not?
the following QT code doesn't work:
manager->networkAccessible()==QNetworkAccessManage
is there some BB10/Cascades specific API we should be using?
Solved! Go to Solution.
01-11-2013 11:35 PM
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 ??
01-12-2013 11:35 AM
01-15-2013 01:27 AM
got the answer from the bb10 developer relations team:
http://qt-project.org/doc/qt-4.8/qnetworkconfigura
01-15-2013 04:53 AM
some sample code would be great ;-)
01-15-2013 07:33 PM
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())
01-16-2013 01:12 AM
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
01-16-2013 02:58 PM
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);