I need to create a complex configuration activity for my app with dynamic modules and i would like to store all the settings into JSON because using sharedprefs XML backend would make things too complex (modules are indipendent and i could have conflicting preference names so i need something able to store an hierarchy of preferences and understand the module concept, i also need to export/import from external files / internet easily).
Each module will have its own “preferencescreen”, a module could appear multiple times (with different “ids”) and i need to have the same file backend for all of them. Another option would be using many sharedpreferences files and export/import to json when needed.
So, do you think it would be ok to extend SharedPreferences and make it use a different backend so i can keep using PreferenceFragments avoiding to reinvent the wheel? Has anyone tried yet?
This is becoming utterly complex so i have decided that the best way to do this is to use multiple SharedPreferences by passing an unique ID to each PreferenceScreen “module”, i then export/import everything using JSON but always going through SharedPreferences standard XML backend. If someone does not post a better solution i will mark this as correct because probably there are not better ways to do that.