Check the previous post "How to integrate Facebook in android"
write a click event for post to wall button and inside click event write a function namedpostToWall()
and function body for postToWall() function is:
Getting Profile Information from Facebook
To get profile information we need to make an api request to facebook graph API. Following is a function that will make an api request to facebook profile graph api and will get profile information from facebook.
The above function will get json data from facebook. You need to parse the json in order to get individual profile data. If you are not aware of json parsing look at this article. Android JSON Parsing Tutorial.
The sample profile json from facebook will be like this
Extending facebook Permissions
If you want user’s other information like checkins, friends list etc., you need to extend facebook permissions while logging in user. Check list of facebook permissions
Getting Access Token
Sometimes you might needed users access token for future purpose usage. Following code will give you currently logged in user access token.
Logout from your app
When user want to stop using facebook for your app, you can provide logout method to clear app state and invalidate access token. So further you can’t make request to facebook from your app.