Languages

Menu
Sites
Language
Disable the turnoff of wifi in Tizen Native Application

Hi,

I am developing a native Tizen Application in which I want the following feature:

I want to keep the wifi connection "ON" all the time and if someone tries to disable the wifi then person should not be able to do so.

Please suggest solution for this.

Responses

3 Replies
Yasin Ali

Hi,

You can register a callback with the Wi-Fi Monitor API (in mobile and wearable applications) to monitor
the Wi-Fi connection state changes. The supported states are defined in the
wifi_manager_connection_state_e enumerator (in mobile and wearable applications).

You can control Wi-Fi state(on/off) and  can also do 'access point management'.

After your device wi-fi getting turn off your code will turn it on again, effectively
keeping wi-fi turned on always.

For code hints check the link below:
https://developer.tizen.org/development/guides/native-application/connectivity-and-wireless/wi-fi

Hope it will help.

Garima .

Hi Yasin,

Thanks for your suggestion. I checked it. But, if wifi is turned off then my device will get disconnected from the server and then turning on it again will not help. I need something that if user press on turnoff wifi then wifi will not tuned off.

Yasin Ali

Implement Wi-Fi within the ecore main loop. When you get WIFI_CONNECTION_STATE_DISCONNECTED
call again
 

error_code = wifi_manager_activate(wifi, __wifi_manager_activated_cb, NULL);

Below code checks wheather wifi manager is activated or not.

bool wifi_manager_activated = false;
wifi_manager_is_activated(wifi, &wifi_manager_activated);
if (wifi_manager_activated)
    dlog_print(DLOG_INFO, LOG_TAG, "Success to get Wi-Fi device state.");
else
    dlog_print(DLOG_INFO, LOG_TAG, "Failed to get Wi-Fi device state.");

Also do not release Wi-Fi calling wifi_manager_deinitialize(wifi);