R RB Smissaert Well-Known Member Licensed User Longtime User Apr 8, 2018 #1 Developing a simple database app in B4A. Currently I handle application settings with File.ReadMap and File.WriteMap etc. and this seems to work well. What are the benefits of using instead the PreferenceActivity or AHPreferenceActivity libraries? RBS
Developing a simple database app in B4A. Currently I handle application settings with File.ReadMap and File.WriteMap etc. and this seems to work well. What are the benefits of using instead the PreferenceActivity or AHPreferenceActivity libraries? RBS
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2018 #2 The better alternative of File.WriteMap is KeyValueStore 2. The purpose of PreferenceActivity is to allow the user to change the settings. Upvote 0
The better alternative of File.WriteMap is KeyValueStore 2. The purpose of PreferenceActivity is to allow the user to change the settings.
R RB Smissaert Well-Known Member Licensed User Longtime User Apr 8, 2018 #3 Erel said: The better alternative of File.WriteMap is KeyValueStore 2. The purpose of PreferenceActivity is to allow the user to change the settings. Click to expand... Ok, in what way is it better? I can let the user change the settings via a menu or a dedicated settings page, using File.WriteMap for persistence. I will look into KeyValueStore 2, but I like the simplicity of File.WriteMap and File.ReadMap. Similar to an .ini file and I am used to that. RBS Upvote 0
Erel said: The better alternative of File.WriteMap is KeyValueStore 2. The purpose of PreferenceActivity is to allow the user to change the settings. Click to expand... Ok, in what way is it better? I can let the user change the settings via a menu or a dedicated settings page, using File.WriteMap for persistence. I will look into KeyValueStore 2, but I like the simplicity of File.WriteMap and File.ReadMap. Similar to an .ini file and I am used to that. RBS
R RB Smissaert Well-Known Member Licensed User Longtime User Apr 8, 2018 #4 https://www.b4x.com/android/forum/threads/b4x-keyvaluestore-2-simple-powerful-local-datastore.63633/#content said: however unlike Map which stores the data in memory, KVS stores the data in a database. Click to expand... But I can write the Map data to a text file. I can see though that if there are a lot of settings, a database for storage has benefits, eg. multiple text replacements. Will switch to KVS2 and see how it works. RBS Upvote 0
https://www.b4x.com/android/forum/threads/b4x-keyvaluestore-2-simple-powerful-local-datastore.63633/#content said: however unlike Map which stores the data in memory, KVS stores the data in a database. Click to expand... But I can write the Map data to a text file. I can see though that if there are a lot of settings, a database for storage has benefits, eg. multiple text replacements. Will switch to KVS2 and see how it works. RBS
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2018 #5 RB Smissaert said: Ok, in what way is it better? Click to expand... KVS is better than File.WriteMap because it supports complex data types. Upvote 0
RB Smissaert said: Ok, in what way is it better? Click to expand... KVS is better than File.WriteMap because it supports complex data types.
R RB Smissaert Well-Known Member Licensed User Longtime User Apr 8, 2018 #6 Erel said: KVS is better than File.WriteMap because it supports complex data types. Click to expand... OK, thanks. Yes, that could be handy, saving me the conversion to and from strings. You convinced me now. Not sure yet about PreferenceActivity or AHPreferenceActivity. RBS Upvote 0
Erel said: KVS is better than File.WriteMap because it supports complex data types. Click to expand... OK, thanks. Yes, that could be handy, saving me the conversion to and from strings. You convinced me now. Not sure yet about PreferenceActivity or AHPreferenceActivity. RBS
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2018 #7 BTW, there are cases where File.WriteMap / ReadMap are more appropriate. For example in B4J apps it can be useful for configuration files as the user can modify it with a text editor. Upvote 0
BTW, there are cases where File.WriteMap / ReadMap are more appropriate. For example in B4J apps it can be useful for configuration files as the user can modify it with a text editor.