hello, Im a bit new in android .I have successfully done posting in my own wall and I wish to post on my friends' wall through my android mobile app. The above example code fits best for my requirement.
BUT I do not understand where to get the userID from(that has to be passed as a string to this method). Please please guide me and provide me with something that would give me the IDs of user's fiends..
here is he link where I found this code:
http://stackoverflow.com/questions/6480582/how-can-i-post-text-on-a-friends-wall-using-the-android-facebook-sdk[
^]
My requirement is exactly the same!
protected void postToWall(String userID){
try {
if (isSession()) {
String response = mFacebook.request((userID == null) ? "me" : userID);
Bundle params = new Bundle();
params.putString("message", "put message here");
params.putString("link", "some link");
params.putString("caption", "{*actor*} just posted this!");
params.putString("description", "description of my link. Click the link to find out more.");
params.putString("name", "Name of this link!");
params.putString("picture", "some pciture");
response = mFacebook.request(((userID == null) ? "me" : userID) + "/feed", params, "POST");
Log.d("Tests",response);
if (response == null || response.equals("") ||
response.equals("false")) {
Log.v("Error", "Blank response");
}
} else {
Log.d(TAG, "sessionNOTValid, relogin");
mFacebook.authorize(this, PERMS, new LoginDialogListener());
}
}catch(Exception e){
e.printStackTrace();}