Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old December 9th, 2012, 07:10 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Dec 2012
Location: Bangalore
Posts: 2
 
Device(s): Samsung Galaxy Tab Gt P3100
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Posting a Text Status using Facebook API in Android - The simplest method

0 down vote favorite


I have been searching a lot to find a way to do this. But nothing seems to be working for me. Can someone please help in doing this?

This is my image button for facebook status post:

This is my mainactivity.java file's corresponding part:

[HIGH]public class MainActivity extends FacebookActivity {

private static final String APP_ID = "XXXXXXXXXXXXXXX";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

. . . . . . .

public void *******Facebook(View v) {
//mfacebook = new Facebook("XXXXXXXXXXXXXXX");
postOnWall("Testing from Android");
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}[/HIGH]Can someone point in the right direction?

Advertisements
xpl0iter is offline  
Last edited by xpl0iter; December 12th, 2012 at 05:14 AM.
Reply With Quote
sponsored links
Old December 19th, 2012, 02:49 AM   #2 (permalink)
Member
 
Join Date: Aug 2010
Location: Norway
Posts: 313
 
Device(s): Samsung Galaxy Nexus
Carrier: Not Provided

Thanks: 0
Thanked 53 Times in 51 Posts
Default

Android SDK Reference - Facebook Developers
miXer is offline  
Reply With Quote
Old December 19th, 2012, 02:51 AM   #3 (permalink)
New Member
Thread Author (OP)
 
Join Date: Dec 2012
Location: Bangalore
Posts: 2
 
Device(s): Samsung Galaxy Tab Gt P3100
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by miXer View Post
Are you kidding me now with that link?
I know it exists and obviously I have tried it and failed, thats why I asked the question here! :/
xpl0iter is offline  
Reply With Quote
Old December 19th, 2012, 08:39 AM   #4 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

You need to prompt the user to authorize with facebook before you can really use the sdk. See here:

https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/

under step 6, after it talks about setting up the project, it walks you through authorization.
__________________
My blog, Inverted Keystrokes, is looking for aspiring developers (not necessarily with Android) to post articles. If you have any development experience and are interested in participating, please PM me. =)
jonbonazza is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:04 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.