At least I would say that this is a bad idea.
But here's an even better idea: distract the specific details of Android and create a clean, readable interface to access the repository that matches your domain .
eg:
interface UserSettings {
void setAutoReloadEnabled(boolean enabled);
boolean isAutoReloadEnabled();
...
}
and then execute it with SharedPreferences
class SharedPreferencesUserSettings implements UserSettings {
final SharedPreferences sharedPrefs;
public SharedPreferencesUserSettings(Context ctx) {
sharedPrefs = ...;
}
@Override void setAutoReloadEnabled(boolean enabled) {
sharedPrefs.editor().putBoolean("...", enabled).commit();
}
...
}
, / ! API SharedPreferences ( commit apply , , ), , .
: , SharedPreferences , , . a. SQLite Database ObjectBox. , .
, ( , ), .