Persist data using SharedPreferences.