Delphi XE7 FMX Android FTP Connection Exception

  

how can i catch a connection exception on android when connection to FTP.

Code At the Moment :

idftp1.Host := Servidor_ftp;
idftp1.Username:= Usuario_ftp;
idftp1.Password:= Contraseña_ftp;
Try
idftp1.Port := StrToInt(Puerto_ftp);
except
idftp1.Port := 21;
End;
Try
idftp1.Connect;
idftp1.Passive := true;
if Carpeta_ftp = ” then
IdFTP1.Put( System.IOUtils.TPath.Combine(System.IOUtils.tpath.getdocumentspath,’temp.txt’), Nombre_pistola+’.txt’ , False )
else
IdFTP1.Put( System.IOUtils.TPath.Combine(System.IOUtils.tpath.getdocumentspath,’temp.txt’), Carpeta_ftp+Nombre_pistola+’.txt’, False );
idftp1.Disconnect;
except
ShowMessage(‘Hay un error con la conexion al FTP, compruebe si tiene internet y si esta bien configurado todo.’);
End;

The connection works correctly when all is configured correctly (server, user, pass, port) but it could be configured incorrectly and in that case it would not connect, if i use that code with windows i get an exception after the timeout, but on android it just stays there and i get the message “Wait for app or kill app”

Thank you.

Comments are closed.