Back

ChooseWifi

ChooseWifi lets the user select a WiFi network in his range.

  app.ChooseWifi( title1, title2, callback, options, extra )

The Callback function returns the name and the ssid of the selected network.
title1 and title2 are the titles for the scanning and the selection process. They default to "Scanning" and "Select WiFi"

Example - Choose WiFi Network



function OnStart()
{
    lay = app.CreateLayout( "linear", "VCenter,FillXY" );

    btnChoose = app.CreateButton( "Choose WiFi", 0.5, 0.1 );
    btnChoose.SetOnTouch( btnChoose_OnTouch );
    lay.AddChild( btnChoose );

    app.AddLayout( lay );
}

function btnChoose_OnTouch()
{
    app.ChooseWifi( "", "", OnWifiChoose );
}

function OnWifiChoose( ssid )
{
     app.ShowPopup( "User selected " + ssid );
}
    Copy     Copy All       Run      

string
function(ssid)
string: "?"
string: "?"