I have an app with 3 build flavors and 3 applicationIds for different ways to use the app. How can I share the preference values among all flavors of the app so if user sets the prefeences under app.flavor1 the same values are available in app.flavor2?
My code:
mPreferences = getSharedPreferences("app_settings",MODE_PRIVATE);
void persistSettings(){
SharedPreferences.Editor editor = mPreferences.edit();
editor.putBoolean("firstRun",false);
editor.putInt("voltage", mVoltage);
editor.putInt("duration",mDuration);
editor.commit();
}
These preferences behave independantly for each app build flavor. Each app uses the same settings but just a different UI. Perhaps there's a better aproach than 3 separate app flavors ?