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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:50:10+00:00 2026-06-09T13:50:10+00:00

I have a json with the following contents: { Dictionary:[ { word: abc meaning:

  • 0

I have a json with the following contents:

{
    "Dictionary":[
        {
            "word": "abc"
            "meaning": "meaning of abc"
        },
        {
            "word": "def"
            "meaning": "meaning of def"
        }
        ]
}

The code which I have written for parsing the json file is as follows:

    public class JSONParser extends Activity
    {
         static JSONObject jObj = null;
        static String json = "";

        // constructor
        public JSONParser() 
        {

        }
public JSONObject getJSONFromInput(InputStream location) 
    {
InputStream isr = location;
Writer writer = new StringWriter();
            char[] buffer = new char[1024];
            try
            {
                Reader reader = new BufferedReader(new InputStreamReader(isr,"UTF-8"));
                int n;
                while ((n = reader.read(buffer)) != -1) 
                {
                    writer.write(buffer, 0, n);
                }
                isr.close();
                json = writer.toString();
            }
            catch (Exception e) 
            {
                Log.e("Buffer Error", "Error converting result " + e.toString());
            }
try 
            {
                jObj = new JSONObject(json);
            } 
            catch (JSONException e) 
            {
                Log.e("JSON Parser", "Error parsing data " + e.toString());
            }

        // return JSON String
        return jObj;
    }
}

I’m getting the below Error:

E/JSON Parser(555): Error parsing data org.json.JSONException: Unterminated object at character 47 of {
E/JSON Parser(555): "Dictionary":[
E/JSON Parser(555): {
E/JSON Parser(555):     "word": "abc"
E/JSON Parser(555):     "meaning": "meaning of abc"
E/JSON Parser(555): },
E/JSON Parser(555): {
E/JSON Parser(555):     "word": "def"
E/JSON Parser(555):     "meaning": "meaning of def"
E/JSON Parser(555): }
E/JSON Parser(555): ]
E/JSON Parser(555): }

Can anyone help me out.

  • 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-09T13:50:11+00:00Added an answer on June 9, 2026 at 1:50 pm

    Key/Value pairs in objects are separated by commas. Your input is missing them.

    Original and corrected (in that order):

        { "word": "abc" "meaning": "meaning of abc" },
        { "word": "abc", "meaning": "meaning of abc" },
    

    See also, the output of JSON Lint:

    Parse error on line 4:
    ...       "word": "abc""meaning": "meaning 
    -----------------------^
    Expecting '}', ':', ',', ']'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code in which i am doing JSON parsing and showing results
I have the following json code file named: sections.json { section1: { priority: 1,
In my servlet I have the following code: response.setContentType(application/json);//set json content type PrintWriter out
I have the following JSON in a file list.txt : { bgates:{first:Bill,last:Gates}, sjobs:{first:Steve,last:Jobs} }
I have the following JSON in a file menu.txt : [{ title:About, url:/about, nodes:[
I have JSON data which contents Strings and Image URLs, and I already parse
I have the following jQuery code which I'm using to populate a jqGrid. It
I have following json data which I want to pass it to server using
I have the following JSON and Jquery Code: JSON { employees:[ { name: Sandy
I have the following: <form class=form id=main-form data-entity=Page data-action=@(action) data-href=/Admin/Contents/Json@(action) > It works find

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.