DroidScript wiki

(was AndroidScript) unofficial documentation by the community

User Tools

Site Tools


Privacy Policy


Version1.42 is out since December 2nd 2016

Frequently Asked Questions


Note for contributors

If you wish to create a new page in the DroidScript wiki, please click on the most appropriate namespace above and follow the notes for contributors there.

Because of spam, it has been necessary to add a CAPTCHA to the registration form and the save option for editing pages. You will not need to prove you are human if you are logged in, so please register.

Please feel free to improve any existing page, as well as adding new pages to increase the sum of public knowledge about DroidScript.

Formatting Syntax


Custom Yes-No-Dialog

(Sample posted by Chris Hopkin in the DroidScript Google Group)

If you want to show a popup window on exit, you could use a custom Dialog.
For example, this is a small app that pops up a custom dialog when the back button is pressed

//Called after application is started.
    function OnStart()
        app.EnableBackKey( false );
        app.ShowPopup( "Touch the Back Button" );
    function OnBack()
        //Create dialog window.
        dlgExit = app.CreateDialog( "Exit?" );
        //Create a layout for dialog.
        layDlg = app.CreateLayout( "Linear", "Horizontal,FillXY" );
        layDlg.SetPadding( 0.02, 0.02, 0.02, 0.02 );
        dlgExit.AddLayout( layDlg );
        var btnYes = app.CreateButton("[fa-check-circle] Yes", 0.3, -1, "FontAwesome");
        btnYes.SetTextSize( 24 );
        btnYes.SetOnTouch( btnYes_OnTouch );
        layDlg.AddChild( btnYes );
        var btnNo = app.CreateButton("[fa-times-circle] No", 0.3, -1, "FontAwesome");
        btnNo.SetOnTouch( btnNo_OnTouch );
        btnNo.SetTextSize( 24 );
        layDlg.AddChild( btnNo );
        //Show dialog.
    function btnYes_OnTouch()
    function btnNo_OnTouch()
sample_code/custom_dialog.txt · Last modified: 2015/08/20 04:55 by