From RAD Studio API Documentation
Jump to: navigation, search


class function GetHomePath: string; static;


static System::UnicodeString __fastcall GetHomePath();


Type Visibility Source Unit Parent
function public
System.IOUtils TPath


Returns the home path of the application's writable scratch directory or storage.

Call GetHomePath to obtain the user's home path on the supported target platforms.

You should use GetHomePath to store settings per user. For example:

TFile.WriteAllText(TPath.GetHomePath() + TPath.DirectorySeparatorChar + 'sample.txt', 'This is my sample text.');

GetHomePath points to the following locations on the various platforms:

  • On Windows, it points to the user’s application data folder.
  • On Mac OS X, it points to the user’s home folder, as defined by the $(HOME) environment variable.
  • On iOS and Android, it points to the device-specific location of the sandbox for the application; the iOS home location is individually defined for each application instance and for each iOS device.

For example:

Platform Sample path
Windows XP C:\Documents and Settings\<username>\Application Data
Windows Vista or later C:\Documents and Settings\<username>\AppData\Roaming
Mac OS X /Users/<username>
iOS Device /private/var/mobile/Applications/<application ID>
iOS Simulator /Users/<username>/Library/Application Support/iPhone Simulator/<SDK version>/Applications/<application ID>
Android /data/data/<application ID>/files

For comparison, here is the wikitable of platform support for FMX.PhoneDialer.TCallState:

Item Description  iOS  Android
csNone No call state. + -
csConnected The phone caller is connected to the called party. + +
csIncoming An incoming phone call. + +
csDialing The phone is in a dialing state. + -
csDisconnected Call is disconnected. + +

See Also