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
Highlighted
New Contributor
Posts: 2
Registered: ‎02-12-2011
My Device: Curve 8520

Network connect states ...

Hi all,

  Would anyone happen to know if there is a native API to interrogate the setting state of each setting under Settings>Network Connections ? So if I wanted to know if the Mobile Hotspot is 'connected' or 'not connected'  I could ask it's state and then toggle it based on the state. I've looked through the Device and Communication docs and see some for Cellular state and some on WIFI, but don't see anything for the others like Internet Tethering or Mobile Hotspot, etc.

 

I'm using BB10 10.1 on Blackberry Z10.

 

TIA,

Marc 

Developer
Posts: 237
Registered: ‎05-21-2012
My Device: BlackBerry RED Z10
My Carrier: WiFi
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Network connect states ...

 

QtNetwork is where it's at.  The QNetworkConfigurationManager class has an isOnline() method:

https://developer.blackberry.com/native/reference/cascades/qtnetwork.html?f=QNetwork

 

Start by watching this video about networking in Cascades on BlackBerry 10:

http://www.youtube.com/watch?v=deMV4-QVzxA

 

You can check to see which transport the user is on by using QNetworkConnection::BearerType enum.  A value of 2 means WiFi:

https://developer.blackberry.com/native/reference/cascades/qnetworkconfiguration.html#BearerType-enu...

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Contributor
Posts: 2
Registered: ‎02-12-2011
My Device: Curve 8520

Re: Network connect states ...

nemory and astanley thank you for your replies. I will check out these resources and proceed with follow-up soon. 

 

Thanks!