This topic describes how to get WLAN state and subscribe to WLAN state changes.
Subscribe
to WLANStateListener
using WLANState.subscribeListener()
method.
//Sample code to subscribe to WLAN state changes try { WLANState.subscribeListener(this); } catch (Exception e) { }
Implement
the WLANStateListener
interface by defining the WLANStateListener.WLANStateChanged()
method.
// Sample code implementing the WLANStateListener interface public void WLANStateChanged(int state) { form.append("WLAN state state is " + state); }
Get the
WLAN state by calling the WLANState.getState()
method.
//Sample code to get the WLAN state WLANState.getState();