-2

I want to know how to save single object(for example user's token) to file system. Is shared preferences best practices? Or it be better to use table with single row or something else?

2 Answers2

2

If your user token is session based (change at every application launch) then it would be better to save in application cache.

If your user token not change as per application life-cycle, then shared preference is best option.

Hardik Bambhania
  • 1,732
  • 15
  • 25
-1

Shared prefrences will be the best choice, https://github.com/Pixplicity/EasyPrefs here is a library to make it easier for you aswell

Ruben Meiring
  • 333
  • 2
  • 21