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 8978913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:43:12+00:00 2026-06-15T19:43:12+00:00

I am trying to parse a result (JSON) fetched from the Facebook API using

  • 0

I am trying to parse a result (JSON) fetched from the Facebook API using FQL in an Android Application.

I have been able to parse all of the result set except this part:

[10151392619250579,10151392618640579,10151392618590579,10151392618785579,10151392618835579,10151392618885579,10151392619010579,10151392619155579]

The FQL query I am making is:

SELECT app_data FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid = me() AND type = 'newsfeed') AND is_hidden = 0 LIMIT 200

Which returns a result like this:

{
    "app_data": {
        "attachment_data": "[]",
        "images": "[10151392619250579,10151392618640579,10151392618590579,10151392618785579,10151392618835579,10151392618885579,10151392619010579,10151392619155579]",
        "photo_ids": [
          "10151392619250579",
          "10151392618640579",
          "10151392618590579",
          "10151392618785579",
          "10151392618835579",
          "10151392618885579",
          "10151392619010579",
          "10151392619155579"
        ]
    }
}

And this is the code I have used to fetch the data:

// GET THE APP DATA
if (JOFeeds.has("app_data"))    {
    String strAppData = JOFeeds.getString("app_data");

    if (strAppData.equals("[]"))    {
        // DO NOTHING
    } else {

        JSONObject JOAppData = new JSONObject(strAppData);

        if (JOAppData.has("photo_ids")) {
            String strPhotoIDS = JOAppData.getString("photo_ids");

            JSONArray JAPhotoIDS = new JSONArray(strPhotoIDS);
            Log.e("JAPhotoIDS", JAPhotoIDS.toString());

            for (int j = 0; j < JAPhotoIDS.length(); j++) {
                JSONObject JOPhotoIDS = JAPhotoIDS.getJSONObject(j);
                Log.e("PHOTO IDS", JOPhotoIDS.toString());
            }
        }

    }
}

The logcat however, always shows this error:

12-13 15:54:36.390: W/System.err(5841): org.json.JSONException: Value 10151392619250579 at 0 of type java.lang.Long cannot be converted to JSONObject

Clearly I am wrong in the coding. Can anyone provide any suggestions on what the proper approach / code should be?

  • 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-15T19:43:13+00:00Added an answer on June 15, 2026 at 7:43 pm

    the part where you are parsing the photo_ids is wrong, it should be like:

    if (JOAppData.has("photo_ids")) {
            JSONArray JAPhotoIDS = JOAppData.getJSONArray("photo_ids");
            Log.e("JAPhotoIDS", JAPhotoIDS.toString());
    
            for (int j = 0; j < JAPhotoIDS.length(); j++) {
                String id = JAPhotoIDS.getString(j);
                Log.e("PHOTO IDS", id);
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse a JSON result fetched from a URL in my Android
I'm trying to parse the JSON data from the Rotten Tomatoes API using GSON
I'm trying to parse json data from the facebook c# sdk. The json data
I have been trying to parse Json into A ListView but when i do
I'm trying to parse JSON result from an Ajax call to .NET web service
I am trying to parse the JSON response from Wordnik's API. This is built
I'm trying to parse the json signed_request you receive from Facebook in perl but
I'm trying to parse a json result from the next google Query: http://www.google.com/ig/calculator?hl=en&q=1USD=?MXN The
I’m trying to parse some JSON from the twitter API and extract the value
I have JSon Values in NSString. I am trying to parse the values from

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.