0

I am a beginner in Facebook Android SDK, and I was searching for 4 hours about how to post a TEXT ONLY to the Facebook Wall with an android app, I saw this Thread, but I didn't find anything about posting text only ...

My Main Activity :

public class ShareWordsActivity extends Activity {

Button ShareFace;

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

    ShareFace = (Button) findViewById(R.id.FaceBtn);

    ShareFace.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {

        }
    });

}

Thanks..

Mohamed Salah
  • 868
  • 1
  • 15
  • 34

2 Answers2

0

download new facebook sdk and integrate it to ypur application and create 64bit keyhash and facebook id from facebook developer account then only you can share text,image to facebook

MurugananthamS
  • 2,395
  • 4
  • 20
  • 49
-1

The simplest way to do that (assuming facebook app is installed on the device) is:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://post/HelloWorld"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

You can explore for more facebook url schemes here: What are all the custom URL schemes supported by the Facebook iPhone app?

For complex operations (even if facebook app is not installed on your device) you should use Facebook SDK for android OR Facebook Graph API (HTTP REST WEB API), You have to create an app in facebook developers platform first, than you'll get an app ID and generate access tokens for the requests. Read more about it and get started here: https://developers.facebook.com/docs/android

Community
  • 1
  • 1
Eliran Kuta
  • 4,148
  • 3
  • 24
  • 28