I'm new to android and i have to implement some code to show count of facebook like on android app.please guys help me out.im totally confused.please guys help me out...
Asked
Active
Viewed 1,623 times
-3
-
what is count ? can you please explain more – sravan May 23 '12 at 05:05
-
@sarvan Kumar,,number of likes – codezoner May 23 '12 at 05:06
-
try library from this post: http://stackoverflow.com/a/23853937/1891118 it completely solve this issue - show like button with count of likes, allows to login and like any url. – Oleksii K. May 25 '14 at 20:59
2 Answers
1
If you Facebook Fan page is http://www.facebook.com/IronMan3TheMovie, you can check the Like count using the Graph API, e.g. http://graph.facebook.com/IronMan3TheMovie. Notice the part where it says: "likes": 62968,
.
Parse the JSON returned by the above call (changes are needed to check your Page) and then display the count.
You can query the graph in the following form:
http://graph.facebook.com/{page_id}
OR
http://graph.facebook.com/{page_user_name}

Niraj Shah
- 15,087
- 3
- 41
- 60
0
Keep one Button and when user clicks that button send 1 to server and add to previous count no....
Code:
HttpClient c= new DefaultHttpClient();
HttpPost postRequest = new HttpPost(YOUR_SERVER_URL?cnt=1);//send cnt value as Request parameter
HttpRespone response = httpClient.execute(postRequest);
//Read the response
BufferedReader reader = new BufferedReader(new InputStreamReader(response
.getEntity().getContent(), "UTF-8"));
//Server side create JSP page.catch count value as
request.getparameter("cnt");

P Srinivas Goud
- 886
- 1
- 12
- 30
-
thanks for the reply.but i really meant is,, i got a android app and it shows how many likes on a specific fb fam page..Can you please give me some help... – codezoner May 23 '12 at 05:22
-
If more than one users are using app and if u want to display how many like it then there should be client server communication required... – P Srinivas Goud May 23 '12 at 05:24