Pregunta

  • How do I get the SD card path and how do I get the executable path in Android and iOS using Delphi XE5?
¿Fue útil?

Solución

Use System.IoUtils.TPath. The SD card path is obtained by using TPath.GetDocumentsPath, and the base directory of the app should be found with TPath.GetHomePath.

uses
  IOUtils;


var
  AppPath, CardPath: string;


  AppPath := TPath.GetHomePath;
  CardPath :- TPath.GetDocumentsPath;

There are several other system path related functions in TPath as well, including these (and many others - you'll have to see which apply to Android and iOS, as the docs aren't clear)

GetTempPath
GetPublicPath
GetCameraPath
GetMusicPath
GetDownloadsPath    
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top