I've been searching for the best approach to using Shared Preferences in MVVM architecture in Android but I could just find pieces and thus having no clear image over ho to do it in the best way. Therefore I have a few questions:
(*SP = Shared Preferences)
I would really appreciate to get some advice for the best practice of SharePreferences in MVVM Android
this diagram represents the MVVM structure very well, in your case you want to save some data in your localDataSourece such as dataBase or Shared preference so it suggests that you do use your logic of saving in the repository level and call those functions from your ViewModel.
if you use the same reference of the shared preference it's best to use it as singleton and not create it every time you read or write it.