Modified code to persist user setting prefs in mobile app.