Directory Reading/Parsing.

1. Callback reading/parsing
// Top of ur .cs file
...
using AndroidCtrl.ADB.Binary;
//or
using AndroidCtrl.ADB.Socket;
 
using AndroidCtrl.ADB.Device.IO;
...
 
// Set the directory to get
Directories _ADBD = ADB.Instance().Device.IO.Directories("directory path");
 
// Use the callback parser for directories only
(void)_ADBD.GetDirectories(DirectoryParserEventHandler);
 
// Or the callback parser for files only
(void)_ADBD.GetFiles(DirectoryParserEventHandler);
 
// Or the callback parser for both, files and directories
(void)_ADBD.Parse(DirectoryParserEventHandler);
 
// Parser callback, this function will be raised after the parser is done with an
// item, so u can get the items in real time from the parser.
public void DirectoryParserEventHandler(object sender, DirectoryParserEventArgs e)
{
     App.Current.Dispatcher.Invoke((Action)delegate
     {
          // Do what u want with the output "e.Element"
          // Add it to an list/-treeview for example
     });
}
 

2. Normal reading/parsing
// Top of ur .cs file
...
using AndroidCtrl.ADB.Binary;
//or
using AndroidCtrl.ADB.Socket;
 
using AndroidCtrl.ADB.Device.IO;
...
 
IEnumerable<IFileSystemItem> elements = ADB.Instance().Device.IO.Directories("directory path").Parse();
 

NOTE
The difference is, if u use Shell to parse the items it will need much more time if u have a lot of symlinks in the directory, because, my DataModel differs between symlink-file and symlink-folder, so the user have to wait a lot of time for the result. If u use BusyBox this will not happen, but if the device is not rooted we need to work with the Shell. So its better to use the 1st way, because the parser will give u any item direct after the parser is done with it.

3. Raw reading
// Top of ur .cs file
...
using AndroidCtrl.ADB.Binary;
//or
using AndroidCtrl.ADB.Socket;
 
using AndroidCtrl.ADB.Device.IO;
...
 
// This will give u the raw items from the Shell/BusyBox request
IEnumerable<string> elements = ADB.Instance().Device.IO.Directories("directory path").ReadRaw();
 
// You can parse it ur own or using 
IFileSystemItem element = ADB.Instance().Device.IO.Directories("directory path").ParseItem("Raw item");