is it possible to create a parcelable session and pass it from one activity to another. is it possible, then how should i do that ?
i am trying to develop a Facebook app using Facebook SDK in android.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no need to pass the session data between Activities. You can directly access the Session data from any Activity by saving the access token and expiry time to persistent memory and then access them either from SharedPreferences in your Activity or via your own Session class.
For a complete example of how to do login to Facebook and request data from different Activities have a look at the Hackbook example of github:
Hackbook app source code on github
and a walk-through on Facebook Developers.
In the HackBook, there is a class called
SessionStorewhich stores the access token and access expiry time. Have a closer look at that as a start.Edit:
Here is a step-by-step tutorial on how to create a basic Android Facebook app with auth and login:
Android Facebook Tutorial
When going through the Hackbook, start by reading the code to the class
Hackbook. It covers the auth, login and some examples calls to get a friend list etc. If you understand this class you’ll understand how the app works.