The SignalIndicators API is used to notify the user of the strength of the WLAN signal. For Windows Mobile / CE, only Zebra Technologies' devices are supported and it is also possible to display a small indicator showing the available signal. The WLAN signal strength is not available on Windows Phone 8 and therefore this API is not supported on that platform.
In order to use this API you must include the following extension in your build.yml
extensions: ["indicators"]
The indicators
extension is also included automatically if you specify the following in your build.yml
app_type: "rhoelements"
Be sure to review the JavaScript API Usage guide for important information about using this API in JavaScript
Be sure to review the Ruby API Usage guide for important information about using this API in Ruby
Hide the icon if it has been previously set by the ‘showIcon’ call.
(All platforms support wlanStatus which can be used to draw your own level indicator or display an appropriate graphic.)
Synchronous Return:
Method Access:
Rho.SignalIndicators.hideIcon()
Rho::SignalIndicators.hideIcon()
Overlays a small signal icon on top of the view indicating the remaining signal strength. This is particularly useful in full screen applications which cover the system signal level indicator.
(All platforms support wlanStatus which can be used to draw your own level indicator or display an appropriate graphic.)
Parameters
The properties associated with the indicator, its position and colour.
The absolute horizontal position of the indicator in pixels. This value is relative to the screen and not the view, so non-fullscreen applications should take care not to display the indicator off screen.
The absolute vertical position of the indicator in pixels. Positive numbers go towards the bottom of the screen. The value is relative to the screen and not the view, so non-fullscreen applications should take care not to display the indicator off screen.
Sets the orientation of the icon, see the remarks section for illustrations.
Possible Values :
The color of the icon. This value must be specified as a Hex value in the format #000000 to #FFFFFF. Alpha values are not supported, i.e. you can only use the component parts RRGGBB.
Synchronous Return:
Method Access:
Rho.SignalIndicators.showIcon(HASH propertyMap)
Rho::SignalIndicators.showIcon(HASH propertyMap)
If the signal is being retrieved via callback, by a previously invoked call to wlanStatus, this method will stop the callback from firing.
Synchronous Return:
Method Access:
Rho.SignalIndicators.stopWlanStatus()
Rho::SignalIndicators.stopWlanStatus()
Retrieve the current signal status. If a callback is provided to retrieve the signal then it will be called periodically at the specified refreshInterval. On Android, instead of being called periodically, the callback will be called when one of the below values changes.
Parameters
Async Callback Returning Parameters: HASH
The signal strength as a value between 0 and 100. Not supported on iOS Platforms:WM, Android
The current ESSID
The Device's MAC address
The Device's adapter name
The current DHCP server's address. Always populated on Android, even on static IP configurations. Not supported on iOS Platforms:WM, Android
Whether the unit hsa a static or DHCP address. Not available on Android and iOS. Platforms:WM
The current gateway IP address
The device's IP address
Signal strength in RSSI terms. Not supported on iOS. Platforms:WM, Android
The current subnet mask
The current WINs server IP address. Not available on Android and iOS. Platforms:WM
Synchronous Return:
The signal strength as a value between 0 and 100. Not supported on iOS Platforms:WM, Android
The current ESSID
The Device's MAC address
The Device's adapter name
The current DHCP server's address. Always populated on Android, even on static IP configurations. Not supported on iOS Platforms:WM, Android
Whether the unit hsa a static or DHCP address. Not available on Android and iOS. Platforms:WM
The current gateway IP address
The device's IP address
Signal strength in RSSI terms. Not supported on iOS. Platforms:WM, Android
The current subnet mask
The current WINs server IP address. Not available on Android and iOS. Platforms:WM
Method Access:
Rho.SignalIndicators.wlanStatus(CallBackHandler callback)
Rho::SignalIndicators.wlanStatus(CallBackHandler callback)
Default: 5000
Property Access:
Rho.SignalIndicators.refreshInterval
Rho::SignalIndicators.refreshInterval
function signal_status_sync(){ var signalValue = Rho.SignalIndicators.wlanStatus(); console.log(signalValue); console.log("Signal Strength is: " + signalValue['signalStrength']); }
def signal_status_sync signalValue = Rho::SignalIndicators.wlanStatus puts signalValue puts "Signal Strength is: " + signalValue['signalStrength'] end
function signal_status_async(){ console.log("Registering Signal Callback"); Rho.SignalIndicators.wlanStatus(signalEvent); } function signalEvent(params){ console.log("Signal Event: (Asynchronous). Strength: " + params["signalStrength"] + ", ESS ID: " + params["essid"] + ", MacAddress: " + params["macAddress"] + ", AdapterName: " + params["adapterName"] + ", DHCP Server: " + params["dhcpServer"] + ", DHCP Static: " + params["dhcpStatic"] + ", Gateway: " + params["gateway"] + ", IP Address: " + params["ipAddress"] + ", RSSI: " + params["rssi"] + ", Subnet Mask: " + params["subnetMask"] + ", Wins: " + params["wins"]); }
def signal_status_async puts "Registering Signal Callback" Rho::SignalIndicators.wlanStatus(url_for(:action => :signalEvent)) end def signalEvent puts "Signal Event: (Asynchronous). Strength: #{@params["signalStrength"]}, ESS ID: #{@params["essid"]}, MacAddress: #{@params["macAddress"]}, AdapterName: #{@params["adapterName"]}, DHCP Server: #{@params["dhcpServer"]}, DHCP Static: #{@params["dhcpStatic"]}, Gateway: #{@params["gateway"]}, IP Address: #{@params["ipAddress"]}, RSSI: #{@params["rssi"]}, Subnet Mask: #{@params["subnetMask"]}, Wins: #{@params["wins"]}" end
function show_signal_icon(){ Rho.SignalIndicators.showIcon({}); }
def show_signal_icon Rho::SignalIndicators.showIcon({}) end
function show_signal_icon(){ Rho.SignalIndicators.showIcon({color:'#0000FF',layout: Rho.SignalIndicators.SIGNAL_LAYOUT_UP}); }
def show_signal_icon Rho::SignalIndicators.showIcon({color:'#0000FF',layout: Rho::SignalIndicators.SIGNAL_LAYOUT_UP}) end
The position of the signal and battery indicators should not be set to overlap
The indicator positions are absolute and so when rotating the screen you should also move the indicator positions accordingly to accommodate the new screen layout.