En/Disable Wifi on the device.
Example - Toggle WiFi
function OnStart()
{
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
tgl = app.CreateToggle( "WiFi", -1, 0.1 );
tgl.SetOnTouch( tgl_OnTouch );
lay.AddChild( tgl );
app.AddLayout( lay );
}
function tgl_OnTouch( enable )
{
app.SetWifiEnabled( enable );
}
from native import app
def OnStart():
lay = app.CreateLayout( "linear", "VCenter,FillXY" )
tgl = app.CreateToggle( "WiFi", -1, 0.1 )
tgl.SetOnTouch( tgl_OnTouch )
lay.AddChild( tgl )
app.AddLayout( lay )
def tgl_OnTouch( enable ):
app.SetWifiEnabled( enable )