I’m developing an android that integrated with the facebook. I have a question about these lines of code
Editor editor = getApplicationContext().getSharedPreferences(KEY,Context.MODE_PRIVATE).edit();
editor.putString(TOKEN, facebook.getAccessToken());
editor.putLong(EXPIRES, facebook.getAccessExpires());
I’m confused about the use of editor.putstring function
My question the value of TOKEN can be? and from where can i see the token names that can be used in the function putString?
I didn’t find information about this issue through the net.
Nada,
The TOKEN is the Facebook Access Token for that user. Storing it in the editor allows you to read it later from the Shared Preferences instead of querying Facebook servers for an access token and going through the login process again. For more context please checkout the Facebook Android Tutorial or a tutorial I wrote here