For example, I have a LocationRepository that gets the last location from the device. But I need to use the last location info in many ViewModels.
Is it better to define a private variable that holds the last location in the LocationRepository and a public getter method to reach it? After that, I can inject that Repository to every ViewModel I need.
Or should I define a lastLocation variable in a static field to be globally reachable?
Which one would be a better approach in terms of testability and single responsibility in an Android project.