I need to search facebook user by using his name or mail-id just like how it works in facebook search box. Any API's available for that.
Thanks in advance.
You will get a bunch of options for searching at this link here: https://developers.facebook.com/docs/reference/api/. On this page, you will need to scroll down a bit till you find the Searching heading.
I am personally, not aware of any provision to search using the email address.
I think you should take a look to the facebook developer documents talking about android and and the example provide in the SDK first
https://developers.facebook.com/docs/mobile/android/build/
It will help you to recognize how to use the facebook-android-sdk
Here's are the code
Bundle params = new Bundle();
params.putString("q", "Your Name");
params.putString("type", "user");//fix
String resp = fb.request("search", params, "GET");//call the request function of android sdk 2.X, ensure you have well setup the library and logged
Related
How can i post message along with Picture using Facebook SDK 3.0 on Android,
The link -> can post small pic with link and all other information.
http://developers.facebook.com/docs/howtos/androidsdk/3.0/feed-dialog/
What i want, is only to post Pic on wall with message, not a link with description ?
I want grab screen shot of my current Android screen that i did and saved it into SD card, i need to post it with message on custom button click.
How can i do this with Facebook SDK 3.0 for android ?
You can use the Graph API to post photos to a user's wall.
See the reference page for more details.
In the Facebook SDK, you would use the Request class to make Graph API calls.
You can use the newUploadPhotoRequest method to add a photo.
If you want to add a description as well, try setting the "message" parameter:
Request photoRequest = Request.newUploadPhotoRequest(...);
Bundle params = photoRequest.getParameters();
params.putString("message", "description goes here");
photoRequest.executeAsync();
Facebook changed this implementation for there version 2 Graph API requests, they recommend a Custom Story instead of posting (if you have your own content to put on the wall of the facebook user beside his comment, or even without his comment)
documentation goes here :
https://developers.facebook.com/docs/android/open-graph?locale=en_GB
just an error in the documentation, the facebook Open Graph objects are refered to by a colon, and not a dot, for example
they mention an open graph Object named "book" in a work space named "books" that way
"books.book"
the correct way is
"books:book"
and after you finish implementation you will need to review your application to facebook, which it's documentation goes here as well
https://developers.facebook.com/docs/apps/review?locale=en_GB
i really hate facebook documentation, it sucks
I am using the facebook API in my app, i know how to post message on wall. my requirement is, i want read the wall information of user recent status information through code .
How can i achieve this...
for example. from my facebook account i want to get the latest status information.
Here's a great example of using the GraphAPI to do that
https://graph.facebook.com/me/feed?access_token={}
Try it out here: https://developers.facebook.com/tools/explorer
EDIT
I stumbled across this the other day. There's a connection from the user object called statuses, which filters the stream even more than feed. As with many graph calls, you can add ?limit=N to limit the result set. So this new way I discovered would look like:
https://graph.facebook.com/me/statuses?limit=1&access_token={}
You should use a third party API such as Easy Facebook SDK. It allows you to do what you are trying to do with ease.
U should check it out here:
http://developers.facebook.com/blog/post/385/
I am working on an application where I need to integrate the Like functionality of Facebook, other than Like I have completed all the features including Share, Upload, etc..
I am stuck in Like because I did,'t find anything for Like in the Facebook SDK I found from the Net on demand.
Can anybody please help me in this, any help or link will be greatly appreciated.
Thanks,
david
From what I understand, you are correct in that there is no Like functionality in the SDK.
It seems that the best way is to use a WebView with the standard Javascript code available from Facebook, however I think this way has it's own problems but looks like it can be accomplished...
See here and here.
If you have OBJECT_ID for the item you want to like, it shouldn't require anything else than sending an empty HTTP POST to http://graph.facebook.com/OBJECT_ID/likes .
Bundle params = new Bundle();
params.putString(Facebook.TOKEN, mFacebook.getAccessToken());
mFacebook.request(objectId + "/likes", params, "POST");
See Publishing in developer docs.
I am trying for a facebook integration on my android application.
My requirement is to read each news feed as and when it comes, and to display it using a toast.
All the sample application I see on net are based on the web GUI.
Can anyone help me with a sample code or hint to read the updates into a variable/string in my application?
Regards,
Dhanesh
using this after login in facebook dialog..
Facebook fb = new Facebook(APP_ID);
String newsfeed=fb.request("me/home");
System.out.println(newsfeed);
for get user news feed....
I'm guessing it's easiest done using Facebook Android SDK (you need permission for your application to access someone's news feed);
http://developers.facebook.com/docs/guides/mobile/#android
And Graph API documentation is a good read too;
http://developers.facebook.com/docs/reference/api/
Maybe there's some better examples but I found those documents rather complete while I was dealing with Facebook accessing.
Check out the Facebook API at http://developers.facebook.com/
Have you looked at facebook's owns api. Mobile Apps. If they don't have a solution on getting new news, then theres probably no clean api to get news an you have to turn to a scrape api or write your own scrape functions.
I want to connect my users to signin in facebook through my app. I did some google and some people are saying use fbrocket where as some http://github.com/facebook/facebook-android-sdk.git. I want suggestions
1) which one is easy to implement?
2) what is the difference between them?
3) Why I need to install a jar. Can I achieve this using some Facebook Api?
Any suggestion is much appreciated.
Thanks rachana.
As Cristian said, fbrocket predates the official SDK and is more or less obsoleted by the official SDK, which is newer, shinier, and mostly based on newer longer-support-lived standards like OpenGraph and OAuth. FBRocket is supposedly being rewritten for these, but there's no release for that yet AFAIK. There's a few things the official SDK is still missing (photo uploading, for instance) but if you just want sign-in-via-facebook, it's definitely the way to go.
I'm not sure I understand your 3rd question though -- you need to include Facebook code, either by a jarfile, android library include, or copy-paste -- in order to actually call the Facebook APIs. The Facebook project is open source; if you're not comfortable including it wholesale, you can freely yank out the bits you need. For example, I've used it in projects that only needed authentication and not publishing, customizing the auth dialog handline and removing all the non-login-related code. You could roll your own implementation based on authenticating via OAuth2 and call all the endpoints yourself, but why bother when Facebook already did the work of giving you the code to do that from Android already?
I recommend to use http://github.com/facebook/facebook-android-sdk.git since it's official and it's updated regularly (it's also really easy to implement and it comes with a couple of nice examples). On the other hand FBRocket seems to be out of date, and the developers are still working on the support for Facebook Graph API.
This is facebook's developer info page, the link you gave seems to be the official Android API.
The jar is the actual library that speaks with facebook.
What action on Facebook are you trying to perform? If you are only trying to allow the user to post content from your application to their facebook page you do this
private static final String FACEBOOK_URL = "http://www.facebook.com/sharer.php?u=
try {
Uri uri = Uri.parse(FACEBOOK_URL + yourcontent + "&src=sp");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
catch (Exception e)
{
e.printStackTrace();
}
}