I have an android app which talks witha Node.js backend, via REST api. We use OAuth token received from Google for authorization, and we have agreed on the flow in which I use the token in HTTP request everytime I make a request.
So, which is the best practice to store the token ? -
a) Store the token in SharedPreference, and use the same SharedPrefrence in the activity that makes the network calls.
OR
b) Store it using a POJO, and use getters and setters to retrieve and clear the token.
I have just started off with network related mini projects in Android. And hence this could be a very basic question. Any help is really appreciated.
Thanks