Languages

Menu
Sites
Language
Active internet connection in Tizen

Hi,

how can I check if there is active internet connection in Tizen?

Thanks,

Jan

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

3 Replies
Raghavendra Reddy Shiva
Hello Jan, You can use the Tizen supported "SystemInfo" device API for determining the network information. For example, let's consider for WIFI network, you can use the below method to check if the Wifi network is available or not, if available you can retrieve the supported Wifi attibutes like WIfi IP Address,SSID and signal strength etc. The parameter "property" here will be "WifiNetwork". tizen.systeminfo.getPropertyValue(property, successCallback, onError); function wifiSuccess(wifi) { var str = ""; try { str += "Wifi network information:
"; str += "Status: " + wifi.status + "
"; str += "SSID: " + wifi.ssid + "
"; str += "IP address: " + wifi.ipAddress + "
"; str += "Signal strength: " + wifi.signalStrength + "
"; output.append(str); } catch (exc) { output.append("Exception: " + exc.message + '
'); } } Similarly, you can check for the Ethernet/Cellular network information. For more information , please refer to the Tizen "SystemInfo" Device API usage. Thanks
Jan Macura
Thanks for this, but I am not sure this will help me, since for example: device can be connected to WIFI without internet connection, right? Any other idea? Jan
Raghavendra Reddy Shiva
You can also do this with JavaScript, window.onload = checkInternetConnection; function checkInternetConnection() { var isOnLine = navigator.onLine; if (isOnLine) { alert('Internet Connection Available'); } else { alert('No Internet Connection Available'); } } And also refer to Tizen support for W3C and HTML5 API's for devices (more in "W3C Network Information API"). https://developer.tizen.org/help/topic/org.tizen.web.appprogramming/html/api_reference/api_reference.htm