If you use SharedPreferences anyway, because you need to keep the values when the application is closed, just use SharedPreferences all the time.
However, to save space on the user's phone, use the package if you only need to exchange data between actions, and it can be canceled after the application is closed.
source
share