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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:42:11+00:00 2026-06-07T05:42:11+00:00

I am trying to parse Json for my android app, but I couldn’t get

  • 0

I am trying to parse Json for my android app, but I couldn’t get it work. I am using org.json library which is port by android. I tried different tutorials but I get and exception called JSONException.

This is the json response I need to parse.

{"status":0,"id":"8bb90729f836f30d179689b01f60fb41-1","hypotheses":[{"utterance":"this is a simple test to see if it's working","confidence":0.88661164}]}

And this is the code I use to parse it.

public void extractJsonData(String feed){
        feed = feed.trim();
        feed = feed.trim();
        try {
                JSONObject jsonObject =new JSONObject();
                Log.i(GetJSon.class.getName(), jsonObject.getString("status"));
                Log.i(GetJSon.class.getName(), jsonObject.getString("id"));
                Log.i(GetJSon.class.getName(), jsonObject.getString("hypotheses"));
                gettting the array of hypotheses
                JSONObject hypotheses = jsonObject.getJSONObject("hypotheses");
                Log.i(GetJSon.class.getName(), hypotheses.getString("utterance"));
                //Log.i(GetJSon.class.getName(), hypotheses.getString("confidence"));
            //}
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Here is the error I get.

07-09 15:54:38.564: I/global(8719): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
07-09 15:54:38.564: I/Json Response(8719): {"status":0,"id":"8bb90729f836f30d179689b01f60fb41-1","hypotheses":[{"utterance":"this is a simple test to see if it's working","confidence":0.88661164}]}
07-09 15:54:38.564: W/System.err(8719): org.json.JSONException: JSONObject["status"] not found.
07-09 15:54:38.564: W/System.err(8719):     at org.json.JSONObject.get(JSONObject.java:287)
07-09 15:54:38.564: W/System.err(8719):     at com.isuru.recordapp.GetJSon.extractJsonData(GetJSon.java:19)
07-09 15:54:38.564: W/System.err(8719):     at com.isuru.recordapp.Main$7.onClick(Main.java:253)
07-09 15:54:38.564: W/System.err(8719):     at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)
07-09 15:54:38.564: W/System.err(8719):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-09 15:54:38.564: W/System.err(8719):     at android.os.Looper.loop(Looper.java:123)
07-09 15:54:38.564: W/System.err(8719):     at android.app.ActivityThread.main(ActivityThread.java:4363)
07-09 15:54:38.564: W/System.err(8719):     at java.lang.reflect.Method.invokeNative(Native Method)
07-09 15:54:38.574: W/System.err(8719):     at java.lang.reflect.Method.invoke(Method.java:521)
07-09 15:54:38.574: W/System.err(8719):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-09 15:54:38.574: W/System.err(8719):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-09 15:54:38.574: W/System.err(8719):     at dalvik.system.NativeStart.main(Native Method)
07-09 15:54:38.574: I/NotificationService(57): enqueueToast pkg=com.isuru.recordapp callback=android.app.ITransientNotification$Stub$Proxy@44d97440 duration=1
07-09 15:54:38.644: W/InputManagerService(57): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44e09d28

I am trying this since yesterday. But still couldn’t find a solution.

  • 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-07T05:42:13+00:00Added an answer on June 7, 2026 at 5:42 am

    You are making your life much harder.

    public void extractJsonData(String feed){         
    feed = feed.trim(); 
    JSONObject json = new JSONObject(feed);
    

    then extract the keyvalue pairs

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

Sidebar

Related Questions

Trying to parse the following json using gson in my android app but givien
I am trying to parse a json object using gson in Android application ,the
I'm trying to parse JSON in android but am having trouble with accessing sub
Hi i am trying to parse Json using gson library.My Json String is this
I'm trying to parse json request using google GSON (on Android although this is
I am trying to parse JSON in an Adobe Flex app, using http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/'>This Tutorial
I am trying to parse a JSON script from my server which contains a
I was trying to parse a JSON string from USGS . However I get
I;m trying to parse a json string which I receive from web server as
I am trying to parse a json file of 5mb, which is causing out

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.