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

  • SEARCH
  • Home
  • 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 8989929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:22:55+00:00 2026-06-15T22:22:55+00:00

The current Facebook API v3.0.2.b will return a com.facebook.Response object that holds the response.

  • 0

The current Facebook API v3.0.2.b will return a com.facebook.Response object that holds the response. Do you know how to parse this? The following code will raise an Exception 🙁

//execute the request
Request request = new Request
(
    session,
    "/fql",
    params,
    HttpMethod.GET,
    new Request.Callback()
    {
        @Override
        public void onCompleted( Response response )
        {
            try
            {
                JSONArray json = new JSONArray( response.toString() );
            }
            catch ( Throwable t )
            {
                System.err.println( t );
            }
        }
    }
);
Request.executeBatchAsync( request );

The error message says:

org.json.JSONException: Unterminated object at character 25 of {Response:  responseCode: 200, graphObject: GraphObject{graphObjectClass=GraphObject, state={"data":[{"pic_square":.....

Does anybody know what’s the correct solution? Shall I use

GraphObject go = response.getGraphObject();

.. how can I get GraphUser-Objects with that?

Sorry, this seems like a trivial issue but processing the Response-object is poorly documented in the facebook docs and I wasn’t able to receive anything about this on the web 🙁

Thank you very much in advance!

Greetings Christopher

  • 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-06-15T22:22:57+00:00Added an answer on June 15, 2026 at 10:22 pm

    this is the solution that worked for me –
    I had to investigate the response and play around a bit with some methods but finally solved it 🙂

    /************************************************************************
    *   Parses the user data from the facebook FQL
    *
    *   "SELECT uid, name, pic_square FROM user WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = me() )"
    *
    *   This is the example query from
    *   {@link http://developers.facebook.com/docs/howtos/androidsdk/3.0/run-fql-queries/}
    *
    *   @param  response    The facebook response from the FQL
    ************************************************************************/
    public static final void parseUserFromFQLResponse( Response response )
    {
        try
        {
            GraphObject go  = response.getGraphObject();
            JSONObject  jso = go.getInnerJSONObject();
            JSONArray   arr = jso.getJSONArray( "data" );
    
            for ( int i = 0; i < ( arr.length() ); i++ )
            {
                JSONObject json_obj = arr.getJSONObject( i );
    
                String id     = json_obj.getString( "uid"           );
                String name   = json_obj.getString( "name"          );
                String urlImg = json_obj.getString( "pic_square"    );
    
                //...
    
            }
        }
        catch ( Throwable t )
        {
            t.printStackTrace();
        }
    }
    

    Hope this helps anybody someday.

    Greetings

    Christopher

    UPDATE

    GraphObject is no longer a class, so just:

    JSONObject  jso = response.getJSONObject();
    JSONArray   arr = jso.getJSONArray("data");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Building an app with the Facebook JavaScript API that will embedded into a page
I'm trying to implement the 1.6 Mobile Facebook API ( http://code.google.com/p/facebook-actionscript-api/downloads/detail?name=GraphAPI_Mobile_1_6.swc ) into an
I'm trying to get the current facebook user for a silverlight game that is
Is that possible with facebook api, to show the currently logged in facebook user's
It is said you cannot create apps automatically with the current facebook API. Create
I've got an app/site that makes a few calls out to the Facebook API
Is it possible to get a user's (The current facebook authenticated user) zip code
I'm getting started with the facebook API. I downloaded the example code from facebook,
I am working on a Facebook app that will allows users to vote on
current code (not working): /^script\s*type=\text\/javascript/i.test(tagName)

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.