-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?

4
  • shared preferences is recommanded. Commented Oct 16, 2019 at 12:05
  • How to securely store access token and secret in Android? Commented Oct 16, 2019 at 12:29
  • if you like any answer you can surely upvote it.. but please don't downvote an answer unless it's totally wrong. Thank you :) Cheers! Commented Oct 16, 2019 at 12:53
  • I didn't downvote any answer. They are all good and more or less the same. Thanks for help Commented Oct 16, 2019 at 14:01

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

-1

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.