function ShowWifiSettings()
{
var packageName = "com.android.settings";
var className = "com.android.settings.wifi.WifiSettings";
var action = "android.intent.action.VIEW";
var category = null;
var uri = null;
var type = null;
var extras = null;
app.SendIntent(packageName, className, action, category, uri, type, extras);
}Can you give us sample code?
This would be a great help.
Thanks and Regards,
Ricky
function OnStart()
{
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
//Create a button for Wifi Settings.
btn = app.CreateButton( "Wifi Settings", 0.4 );
btn.SetMargins( 0, 0.025, 0, 0.025 );
btn.SetOnTouch( OpenWifiSettings );
lay.AddChild( btn );
//Create a button for Tethering Settings.
btn = app.CreateButton( "Tethering Settings", 0.4 );
btn.SetMargins( 0, 0.025, 0, 0.025 );
btn.SetOnTouch( OpenTetheringSettings );
lay.AddChild( btn );
//Create a button for Bluetooth Settings.
btn = app.CreateButton( "Bluetooth Settings", 0.4 );
btn.SetMargins( 0, 0.025, 0, 0.025 );
btn.SetOnTouch( OpenBluetoothSettings );
lay.AddChild( btn );
app.AddLayout( lay );
}
function sendIntent( packageName, className )
{
var action = "android.intent.action.VIEW";
var category = null;
var uri = null;
var type = null;
var extras = null;
app.SendIntent(packageName, className, action, category, uri, type, extras);
}
function OpenWifiSettings()
{
sendIntent( "com.android.settings", "com.android.settings.wifi.WifiSettings" );
}
function OpenTetheringSettings()
{
sendIntent( "com.android.settings", "com.android.settings.TetherSettings" );
}
function OpenBluetoothSettings()
{
sendIntent( "com.android.settings", "com.android.settings.bluetooth.BluetoothSettings" );
}However, if you are looking at a topic from 2015, please look through the whole topic before asking questions.
All that sample code does is to open the standard Android WiFi Settings menu.