Bennett Young
Bennett Young

Reputation: 161

Posting a High Score in Facebook from Android App

I had just a Mastermind-like game app done in Eclipse Android. What I wanted now is for the user to have his/her score posted on his/her Facebook account. In an AlertDialog builder, when the user selects the "Post to my Facebook" button, it should be able to really do. Actual codes are highly appreciated!

Cheers

Upvotes: 1

Views: 3439

Answers (1)

Ovidiu Latcu
Ovidiu Latcu

Reputation: 72331

If you want to especially use just Facebook you should use the FacebookSDK for Android.

But this may give you a lot of problems as far as I know, and instead I would recommend to make a Share Intent and let the users choose where to shere their score :

    Intent shareIntent=new Intent(Intent.ACTION_SEND);
    shareIntent.setType("text/plain");
    shareIntent.putExtra(Intent.EXTRA_TEXT,"Your score and Some extra text");
    shareIntent.putExtra(Intent.EXTRA_SUBJECT, "The title");
    startActivity(Intent.createChooser(shareIntent, "Share..."));

This will let the user to choose from more applications installed on his phone such as Facebook, Twitter... etc.

Upvotes: 6

Related Questions