Francois 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.
Free Custom TIniFile Class Source For Android And Windows by Delphi XE5 XE6 XE7 XE8 10 Seattle Berlin Firemonkey, Delphi Android, Delphi IOS is licensed under a Creative Commons Attribution 4.0 International License.