I want to save program settings(changed by user, then read at program start), i.e baud rate, preferred communication method, calibration factors..etc. what is the best method to do that? An example is highly appreciated.
You can save it in text file or use keyvaluestore2
B4X:
'To save your data
Dim m As Map
m.Initialize
m.Put("baud_rate", your_baud_rate)
m.Put("pref_communication", your_pref_comm)
m.Put("calibration",your_calibration)
File.WriteMap(File.DirInternal,"settings.dat",m)
'TO READ THE VALUES TOO
Dim myData As Map = File.ReadMap(File.DirInternal,"settings.dat")
I don't think he can use keystore because the user wont be able to modify the settings outside of the app because the keystore file is internal, right?
And if the setttings file is to be externally accessible/modifyable, wouldn't there be a problem of the app not being able to read/write to that file due to all the lockdowns that API 29 has on external files/memory?
But if you meant that the user would make the changes to settings from *within* the app, then disregard the above because I initially interpreted the OP as if the user would modify the settings file external to the app, then the app would read in the new settings
I don't think he can use keystore because the user wont be able to modify the settings outside of the app because the keystore file is internal, right?