Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey, Delphi Android, Delphi IOS

Free Custom TIniFile Class Source For Android And Windows

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

TIniFile for Android | Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSFrancois Piette on his blog “Behind the connection” writes about how to create your own custom TIniFile class for your Delphi Android and Windows Firemoneky applications. He describes how to model a custom class using the SharedPreferences API to make INiFiles work on both the Android and windows platforms. Typically with Windows applications, the INI file format is a simple text file with a Key/Value pairs and all the related pairs related grouped into a a section.  With an Android application, there is no concept of a section. Therefore, to create the section concept, Francois simply prefixes each key by its section name surrounded by brackets like this: ‘[‘ + Section + ‘]_’ + Key.  In addition, Delphi has a class encapsulation of the Windows INI files (TIniFile) which resides in the “System.IniFiles unit”. Francois uses the same class name in his implementation and even the same class signature by inheriting from the existing TCustomIniFile for Android and TInifFile for Windows. However, instead of using “System.IniFiles”, he uses “FMX.Overbyte.IniFiles” in the uses clause. Stop on over and read Francois’s article and find out how he handles file storage location and see his example code. While you are there, you can download the full source code of his custom class and demo.

Get the full source code and demo here

Exit mobile version