Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3407634
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:46:31+00:00 2026-05-18T05:46:31+00:00

I’m new to Facebook API on Android, and basically, what I’m trying to do

  • 0

I’m new to Facebook API on Android, and basically, what I’m trying to do is creating custom wall post for an application I’m developing.
Like when you listen a Shazam a song and you can share the result with your friends.
I believe I’ve got to create a custom attachment. Here’s my code for setting the attachment:

mPostButton.setOnClickListener(new OnClickListener() {

    public void onClick(View v) {
        Bundle myParams = new Bundle();
        String attachment="{\"name\":\"Gran Turismo 5\"," +
           "\"href\":\"http://www.unknown.com/?lang=fr\"," +
           "\"caption\":\"Sony Computer Entertainment\",\"description\":" +
           "\"Une vidéo proposée par Cedemo.\",\"media\":" +
           "[{\"type\":\"image\",\"src\":" +
           "\"http://www.unknown.com/prepicture//thumb_title/15/15061_1.jpg\"," +
           "\"href\":\"http://www.unknown.com/?lang=fr\"}],\"properties\":" +
           "{\"Autre lien\":{\"text\":\"Cedemo\",\"href\":\"http://www.unknown.com\"}}}";
        myParams.putString("attachment", URLEncoder.encode(attachment);
        mFacebook.dialog(Option.this, "stream.publish",myParams,
                new SampleDialogListener());

And then, later on:

public class SampleDialogListener extends BaseDialogListener {

    public void onComplete(Bundle values) {
        final String postId = values.getString("post_id");
        if (postId != null) {
            Log.d("Facebook-Example", "Dialog Success! post_id=" + postId);
            mAsyncRunner.request(postId,values, new WallPostRequestListener());
        } else {
            Log.d("Facebook-Example", "No wall post made");
        }
    }
}

I didn’t wrote the attachment String, It’s just a test taken from another question made in this forum. Anyway, when I call myAsync.request, my app shows an error message, how am I supposed to pass the attachment to my dialog?
Hope I’ve been clear enough.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:46:31+00:00Added an answer on May 18, 2026 at 5:46 am

    Are you sure you need to set custom parameters? It sounds like you can just want to post a Facebook message directly to the wall: you can do this by simply handing in the message parameter as a string — you only need all that JSON if you want to attach an image etc. And note on facebook’s page it says using this api call won’t post a status update that others can see on their feed, it will just appear on their own wall. If you just want to post a message with a link you should just be able to use your mAsyncRunner (once you have your valid Facebook session) using this:

    String message = "Post this to my wall";
    Bundle parameters = new Bundle();        
    parameters.putString("message", message);   
    mAsyncRunner.request("me/feed", parameters, "POST", new WallPostRequestListener());
    

    Also may help if you posted the error/response code you’re getting from Facebook.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.