User Tools

Site Tools


Privacy Policy


Version 2.50 is out since Jan 1st 2022

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


This is an old revision of the document!

List all Folders and Subfolders

(Sample Code taken from the DroidScript Google-Group)

//Called when application is started.
function OnStart()
  //Create a layout with objects vertically centered.
  lay = app.CreateLayout("linear", "VCenter,FillXY");
  //Create a list and add to layout.
  lst = app.CreateList("Please Wait");
  //Add layout to app.
  lst.SetList(GetDirs("/sdcard/DroidScript", []).sort());
//Check a directory for subdirectories.
function GetDirs(path, kidsfound)
  if (path != null && app.IsFolder(path))
    var children = app.ListFolder(path);
    for (var i = 0; i < children.length; i++)
      var fil = path + "/" + children[i];
      if (app.IsFolder(fil))
        kidsfound = GetDirs(fil, kidsfound);
  return kidsfound;
sample_code/list_folders_and_subfolders.1418833019.txt.gz · Last modified: 2014/12/18 00:17 (external edit)