Questions tagged [jsonexception]

Java Exception that is thrown to indicate a problem with the JSON API, as attempts to parse or construct malformed documents, use of null as a name or type mismatches on lookups.

171 questions
-1
votes
3 answers

How to correctly send JSON string from PHP and parse it in Java to get POJO?

I am using json_encode to create JSON string in PHP. $result is my SQL result. $final_op=""; if(empty($result) == false){ $rows = array(); while($r = mysqli_fetch_assoc($result)) { $rows[] =…
vikas devde
  • 11,691
  • 10
  • 35
  • 42
-1
votes
2 answers

JSONObject issue A JSONObject text must begin with '{' at

So Im trying to use this json file, but when I try to parse it with JSONobject it gives me the error. I tried finding similar issues but it seemed that ppl didnt have the same thing. The code produce this error msg Exception in thread "main"…
Kleppa
  • 11
  • 4
-1
votes
1 answer

Value of type java.lang.String cannot be converted to JSONObject

I make "GET" request in order to get a JSON object. When i try to read the response, an error is thrown. The error is descriped in the header. It's a really miracle for me, because when i run the app on the emulator or in the browser, i get JSON…
David
  • 351
  • 3
  • 11
-1
votes
1 answer

java.lang.IllegalArgumentException, java.lang.NullPointerException, org.json.JSONException in android project

package com.example.attendance; import java.util.ArrayList; import java.util.Calendar; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; import android.content.Context; import…
-1
votes
3 answers

Android Connection with MYSQL database using php

I am trying to connect my Android login page with MySQL database present on the server. But I am facing problem now in passing php file through Android. My connection from PHP to MySQL database is successful, though. PHP code:
-1
votes
1 answer

JSON Parser﹕ Error parsing data org.json.JSONException: Value null of type org.json.JSONObject$1 cannot be converted to JSONObject

When i execute the code given below, it shows me an exception like "JSON Parser﹕ Error parsing data org.json.JSONException: Value null of type org.json.JSONObject$1 cannot be converted to JSONObject" Can anyone here help me ? public class…
Jay Tanna
  • 1
  • 2
-1
votes
2 answers

How to parse json with multiple objects in a array?

I have JSONArray having following structure: { "People":[ { "006MST21IND":{ "desc":"MST21 BAL. PR. THERMOSTATIC STEAM TRAP", "attribute":"1,b_“F”ELEMENT / c_`G' ELEMENT;2,b_“F”ELEMENT / c_`G'…
-1
votes
1 answer

PHP unexpected JSON sent

I'm using the following code to access my DB using PHP
La bla bla
  • 8,558
  • 13
  • 60
  • 109
-2
votes
2 answers

Expected BEGIN_ARRAY but was STRING at line 1 column 1 path

I'm trying to pass in a JSON file from within an app to populate some views and perform some functions within the app but I keep getting this error. com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was…
DanIke
  • 51
  • 10
-2
votes
1 answer

JSONException Error

Note that the Asynctask is working perfectly. What is the problem here? Can anyone please help me?
Mag
  • 89
  • 1
  • 11
-2
votes
1 answer

org.json.JSONArray cannot be converted to JSONObject showing in android

Iam Creating an android application to read json values webservice. The service returning following json…
-2
votes
3 answers

Parsing JSON in android, typeMismatch error?

I am using the wikipedia API, it returns result in a JSON…
WISHY
  • 11,067
  • 25
  • 105
  • 197
-2
votes
2 answers

JSONException No value for..Android app

I know that there are many posts about this particular error, but none of them are solving my issue and I am new to Android development. As a result of this error, I am unable to see the data in a listView for an app. The following is my…
JohnWilliams
  • 139
  • 1
  • 13
-2
votes
1 answer

validate json but JSONException unterminated object

My question has been asked several times but I couldn't find a solution for my problem. I am trying to parse the API: 1, which is valid JSON For that I built a function to parse the data : private String[] getArticlesDataFromJson(String…
-2
votes
3 answers

Getting JSONExeption: No Value

Here is my function for initializing Json Object public void setJsonsObject() throws ClientProtocolException, IOException, JSONException { StringBuilder url = new StringBuilder(URL); HttpGet get = new HttpGet(url.toString()); …
Hayk Nahapetyan
  • 4,452
  • 8
  • 42
  • 61
1 2 3
11
12