You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently on JVM and I am using PreferencesSettings.Factory with Preferences.userRoot(). The key/value pairs are written into $HOME/Library/Preferences/com.apple.java.util.prefs.plist. Other apps are also writing into this file though so you could potentially overwrite values. This can be solved by something like Preferences.userRoot().node("com.my.app.id). This brings me to my second point though that clearing them is tricky. My app also has a database and local files all of which are saved in a folder of mine. I'd like my settings to be also stored in that exact same directory, that way all the data belongs together. Clearing all the data manually, is easy since I just need to delete the directory.
Therefore I'd like to see a FileSettings implementation that writes the key/value pairs to a File. The implementation could be just 100% what Android does with SharedPreferences. So an XML file, a FileSettings.Factory method where if you pass a name you get a different xml file.
The text was updated successfully, but these errors were encountered:
I'm potentially open to this, but somewhat wary because this would require that the library own more of the storage implementation details than most existing Settings implementations. I'm not convinced that simply copying what SharedPreferences does would be the best way forward, though it would certainly make implementation easier. But you're welcome to give it a try in your own code and report back here on how it goes.
Alternatively, you could explore migrating to DataStore or DataStoreSettings. DataStore does something similar to what you want, but in a Flow-based API. It's backed by an explicit file which you can delete as needed.
I'm currently on JVM and I am using
PreferencesSettings.Factory
withPreferences.userRoot()
. The key/value pairs are written into$HOME/Library/Preferences/com.apple.java.util.prefs.plist
. Other apps are also writing into this file though so you could potentially overwrite values. This can be solved by something likePreferences.userRoot().node("com.my.app.id)
. This brings me to my second point though that clearing them is tricky. My app also has a database and local files all of which are saved in a folder of mine. I'd like my settings to be also stored in that exact same directory, that way all the data belongs together. Clearing all the data manually, is easy since I just need to delete the directory.Therefore I'd like to see a
FileSettings
implementation that writes the key/value pairs to aFile
. The implementation could be just 100% what Android does with SharedPreferences. So an XML file, aFileSettings.Factory
method where if you pass a name you get a different xml file.The text was updated successfully, but these errors were encountered: