Connection
The Connection object gives access to the device's cellular and wifi connection information.
This API is considered to be in Beta.
The function and property signatures listed below could change at anytime.
Once the API moves out of Beta it will be distributed as part of the core API.
Last Updated: Sun Dec 30 2012 18:15:34 GMT-0500 (EST)
Supported Platform(s)
- BlackBerry 10 |
Configuration Document Settings
To use all of the API described for this object, you must ensure the following settings are in your configuration document: |
You must declare the feature element(s) below in your configuration document: |
Feature ID | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
---|---|---|---|---|---|---|---|
<feature id="blackberry.connection" /> | Y |
Permission Elements (PlayBook and BlackBerry 10+) |
---|
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. |
Events
blackberry.connection.connectionchange
This event is fired by the system. If you want to listen to the event you can do so using the blackberry.event.addEventListener function and remove the listener using the blackberry.event.removeEventListener function.
The connectionchange event is triggered whenever the network connection type changes.
Supported Platforms | |
---|---|
- BlackBerry 10 |
Parameters | |
---|---|
yourCallbackFunction |
The callback function that will be invoked on the connectionchange event.
info: An object with the pertinent information. info.oldType: The network connection type prior to the event. info.newType: The new network connection type. |
Code Example:
|