wimpie3 Well-Known Member Licensed User Longtime User Oct 9, 2024 #1 I've seen that AS Settings uses the KeyValueStore to save the data. Is there a way to import/export these settings and store them in my own database, without passing through the KeyValueStore? Would be cool if the data could be exported/imported through a map or a json string. There seems to be a way to get hold of the KeyValueStore itself, but you can't write it back?
I've seen that AS Settings uses the KeyValueStore to save the data. Is there a way to import/export these settings and store them in my own database, without passing through the KeyValueStore? Would be cool if the data could be exported/imported through a map or a json string. There seems to be a way to get hold of the KeyValueStore itself, but you can't write it back?
Alexander Stolte Expert Licensed User Longtime User Oct 9, 2024 #2 Use the ValueChanged event to track property changes. Then you can push the change to your own database without having to manually fill all properties yourself, after application restart. Or use AS_Settings1.SaveMode = AS_Settings1.SaveMode_Manual then nothing is saved automatically and you have to track the changes together with the valuechanged event. And after an application restart, you simply set the values manually that come from your own database. Use the "DefaultValue" parameter if you add a property. Example: B4X: Dim MyOwnProperty As Boolean = False AS_Settings1.MainPage.AddProperty_Boolean("Basic","PropertyName_1","Light/Dark","",Null,MyOwnProperty) or use the automatic save with the keyvaluestore and delete all settings and fill it with the values from your own database. Upvote 1
Use the ValueChanged event to track property changes. Then you can push the change to your own database without having to manually fill all properties yourself, after application restart. Or use AS_Settings1.SaveMode = AS_Settings1.SaveMode_Manual then nothing is saved automatically and you have to track the changes together with the valuechanged event. And after an application restart, you simply set the values manually that come from your own database. Use the "DefaultValue" parameter if you add a property. Example: B4X: Dim MyOwnProperty As Boolean = False AS_Settings1.MainPage.AddProperty_Boolean("Basic","PropertyName_1","Light/Dark","",Null,MyOwnProperty) or use the automatic save with the keyvaluestore and delete all settings and fill it with the values from your own database.
wimpie3 Well-Known Member Licensed User Longtime User Oct 10, 2024 #4 There does seem to be an issue... When I use B4X: AS_Settings1.SaveMode = AS_Settings1.SaveMode_Manual and I try to add an action with Code: the value shown on the AS Settings page is java.lang.Object@6c669567. When I leave out the SaveMode setting, it works fine. Upvote 0
There does seem to be an issue... When I use B4X: AS_Settings1.SaveMode = AS_Settings1.SaveMode_Manual and I try to add an action with Code: the value shown on the AS Settings page is java.lang.Object@6c669567. When I leave out the SaveMode setting, it works fine.
Alexander Stolte Expert Licensed User Longtime User Oct 10, 2024 #5 Please test this pre release version Attachments AS_Settings.b4xlib AS_Settings.b4xlib 22.2 KB · Views: 377 Upvote 0
wimpie3 Well-Known Member Licensed User Longtime User Oct 10, 2024 #6 Yes, working now with 2.09! Upvote 0