语言

Menu
Sites
Language

Check internet connection availability

Sometimes you have to check if Internet connectivity is available. The below code shows how to use Tizen Native APIs to check if there is a Wi-Fi or the Cellular network available.

响应

2 回复
Dima S

Hi 

i have a couple of questions :

1. Will this work on TV nacl app?  (WIFI/ETH)

2.  the include files , <net_connection.h> , <dlog.h>  , how do i get them? 

3. will this work on simlator / emulator as well?

 

thanks

Jay Sharma

Hello,
Please correct the code, it has wrong condition:

AS-IS:

    if(connection_get_type(connection, &type) != CONNECTION_ERROR_NONE){

TO-BE:

    if(connection_get_type(connection, &type) == CONNECTION_ERROR_NONE){