Embarcadero has a page up which shows a map of all of the TPath functions in Delphi XE5 Firemonkey and what they resolve to on each platform. It also details which path functions resolve on Android, IOS, Windows, and OSX. The most useful path is probably going to be TPath.GetDocumentsPath and most of the time that is probably the path you want to use to store files for your app in. TPath is located in System.IOUtils so you will need to include that in your uses clause to be able to use TPath. There are some other useful paths defined especially for specific types of applications like there is a TPath.GetCachePath function which could be a place to store any cache files that you use in your app. TPath.GetCameraPath, TPath.GetMusicPath, and TPath.GetDownloadsPath also look useful but only on Android (they don’t resolve to anything on IOS according to the page. Also check out this demo app from Embarcadero where they demonstrate deploying a file and then loading it from TPath.GetDocumentsPath.
Head over to Embarcadero’s page to get the full cross platform system directories path function map.
Hello,
I have a problem about updating this file.. If i create a file in document forder, like a TEXT file, when i compile my program, the Uninstall / Install Process delete my file.
Can you give Solution to create files able to SURVIVE the UnInstall/Install process.
Thanks…
Maybe use something like SharedPreferences:
https://stackoverflow.com/questions/18799540/accessing-androids-sharedpreferences-class-from-delphi
http://delphihaven.wordpress.com/2013/09/12/a-few-xe5-related-bits/
The local files being deleted when you install and uninstall an app is done by Android and IOS. Other tools like Adobe AIR do the same thing.
For IOS also check out:
http://www.fmxexpress.com/configure-the-settings-bundle-for-your-delphi-xe5-firemonkey-app-on-ios/
http://www.fmxexpress.com/store-and-sync-settings-between-ios-and-osx-devices-using-icloud-with-delphi-xe5-firemonkey/
Hello,
I have written an Android app, the cache memory I would like to automatically delete on close the app.
With GetCachePath I get though the Path.
var
spath: string;
begin
sPath: = TPath.Combine (TPath.GetTempPath, ”);
deleteFile (spar); // DeleteFile only deletes a file
Can you help me?
Thanks.
bye
http://docwiki.embarcadero.com/Libraries/XE7/en/System.IOUtils.TDirectory.Delete