Where does my FireMonkey middleware store its settings?

What are the best practices when a cross-platform FireMonkey program needs to put INI files? Are INI files the right choice?

+3


source to share


3 answers


For Android: in "shared storage"

For macOS: in the INI file

https://delphihaven.wordpress.com/2015/06/11/ccr-prefsinifile-on-github/



CCR.PrefsIniFile on Chris Rolliston's GitHub (it's also on stackoverflow: https://stackoverflow.com/users/2778930/chris-rolliston )

Just a little post to say the native API Preferences wrappers for Android, iOS and OS X I posted on Google Code a while ago on GitHib:

https://github.com/chrisrolliston/CCR.PrefsIniFile

Both Android and Apple versions should now compile to XE8 as well.

+5


source


If you are looking for one place that will fit all platforms, I'm afraid you won't find it.

You can see that each platform has a different preference for where the settings files are stored.

So, you should read the instructions for each platform and make sure your program uses these locations.

If this fails, and the attempt to save the settings in a different folder may fail, as many platforms restrict access to all folders.




Now, what format should you use for? Should it be INI files or something else?

In windows it is entirely up to you which format you use. You can use the registry, INI files (quite common), XML files (these are pretty common lately), or even some custom formats like typed files (binaries) that Delphi can work with.

But this does not apply to all platforms. Some platforms may even restrict you in which format you save your settings.

So, you should read the platform settings on this matter and adapt.

+1


source


In windows, INI files have become ubiquitous as a fast, easy-to-use method. But as they got bigger, they got much slower and it was difficult to implement structured storage. Hence, moving from INI files to registry / registries. But this is not a cross platform option, so some have turned to INI file structures, but depending on the size it can still be slow. One of the more interesting approaches I've seen is this sprint skill, which (incorrectly) uses JSON to create files equivalent to old INI files (and also allows structuring). See here JSON - new INI file... As for where, I think you need to read the guidelines for each purpose, as the recommended location may be different for each.

0


source







All Articles