title: how to show the availble files in Android memory with Firemonkey
body: <p>In Delphi for Windows one has the <code>TOpenDialog</code> and the commands such as <code>FindFirst</code>.
  In Firemonky/Android there is no TOpenDialog<code>, but according to many forums</code>FindFirst` should exist. However there are more who have problems with it, but no solution:</p>
  
  <p>In Windows the following functions properly:</p>
  
  <pre><code>var iResult,n:integer;
  Filenaam,s:string;
  sr: TSearchRec;
  
  begin
  
  with form1 do
  begin
      L_toonactie.Text:='start file list';
      M_filelist.lines.Clear;
      Filenaam:=
            System.IOUtils.tpath.GetDocumentsPath+'\assets\internal\'+'*.*';          
      iResult:=FindFirst(Filenaam,faAnyFile,sr); 
      str(iresult,s);L_toonactie.Text:='started '+s;
      n:=0;
      while (iResult=0) do
      begin
          inc(n);
          L_toonactie.Text:='busy file list';
          s:=s+sr.Name+sLineBreak;
          M_filelist.lines.add(sr.name);
          iResult:=FindNext(sr);
      end;
    FindClose(sr);
   // str(n,s);if n=0 then L_toonactie.Text:='nothing found' 
  else L_toonactie.Text:='ready file list ('+s+'found)'
  </code></pre>
  
  <p>end;}</p>
  
  <p><code>iResult</code> always has <code>-1</code></p>
  
  <p>Another solution found was:</p>
  
  <pre><code>procedure toon_files2(pathSTRING:string);  
  var
     {$IFDEF FPC}
     patharray : NSArray;
     filename,path,ext,subdir:NSString ;
     fileManager: NSFileManager ;
     direnum:NSEnumerator;//NSDirectoryEnumerator ;//NSDirectoryEnumerator;
     //direnum:NSDirectoryEnumerator ;//NSDirectoryEnumerator;
     i,n:integer;
     error:NSError;
     {$ENDIF}
     k:integer;
  begin
  form1.L_toonactie.Text:='start file list';
  
  {$IFDEF FPC}
  path:= NSSTR(PChar(pathSTRING)); // =NSHomeDirectory();//
  fileManager:= NSFileManager.defaultManager;
  patharray:= fileManager.contentsOfDirectoryAtPath_error(path,@error);
  n:=0;
  k:=0;
  direnum:= patharray.objectEnumerator ;
  repeat
      inc(k);
      filename:=direnum.nextObject;
      if string(fileName.UTF8STRING)&lt;&gt;'' then
      begin
          ext:= filename.pathExtension;
          if UpperCase(string(ext.UTF8STRING))='KPF' then
          begin
              form1.L_toonactie.Text:='found a file';
              SetLength(pngLIST,n+1);
              pngLIST[n]:=string(Path.UTF8STRING)+string(filename.UTF8STRING);
              form1.memo1.Lines.Add(pngLIST[n]) ;
              inc(n);
          end;
      end;
  until string(fileName.UTF8STRING)='';
  {$ENDIF}
  
  if k=0 then form1.L_toonactie.Text:='nothing found' 
  else form1.L_toonactie.Text:='ready file list';
  end;
  </code></pre>
  
  <p>But does not work either.</p>