This site permanently moved to
https://droidscript.github.io
. Please update links accordingly.
You are being forwarded automatically in 3...
[stay here]
Back
SetWifiEnabled
Hello World
En/Disable Wifi on the device.
app.SetWifiEnabled(
enable
)
See Also:
SetWifiEnabled
,
IsWifiApEnabled
,
WifiScan
Example - Toggle WiFi
click to expand contents
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
)
;
}
Copy
Copy All
Run
Boolean
loading