Show Some Love

How to solve an error “android Error parsing data org.json.JSONException: End of input at character 0 of”?

This forum was posted on Tuesday, March 12, 2013 11:15:59 AM

I am using AsyncTask to parse JSON from server. but i found a issue When I execute my apps. in my logcat my JSON seems good but after that there's an error msg android Error parsing data org.json.JSONException: End of input at char 0 of. I have already attempted little ideas from forums but i was not still get the best approach to fix this. here my code snippet :

protected String doInBackground(String... arg0) {
// TODO Auto-generated method stub
List params = new ArrayList();
JSONObject json = jParser.makeHttpRequest(url_level_detaildatamerchant "GET" params);
Log.d("Get List :" json.toString());
try {
int success = json.getInt(TAG_SUCCESS);
if (success == 1) {
data = json.getJSONArray(TAG_DATA);
for (int i=0; i map = new HashMap();
map.put(TAG_Pk_Merchant_ID Pk_Merchant_ID);
map.put(TAG_Fk_Ms_DataLevel2_ID Fk_Ms_DataLevel2_ID);
map.put(TAG_Fk_Ms_City_ID Fk_Ms_City_ID);
map.put(TAG_Fk_Ms_Sales_ID_CreatedBy Fk_Ms_Sales_ID_CreatedBy);
map.put(TAG_Fk_Ms_Sales_ID_LastUpdateBy Fk_Ms_Sales_ID_LastUpdateBy);
map.put(TAG_CreatedDated CreatedDated);
map.put(TAG_LastUpdateDated LastUpdateDated);
map.put(TAG_Descriptions Descriptions);
map.put(TAG_Address Address);
map.put(TAG_Telpon Telpon);
map.put(TAG_Handphone Handphone);
map.put(TAG_BB_PIN BB_PIN);
map.put(TAG_email email);
map.put(TAG_Longitude Longitude);
map.put(TAG_Latitude Latitude);
map.put(TAG_Path_PhotoProfile Path_PhotoProfile);
map.put(TAG_Is_Deleted Is_Deleted);
} catch (Exception e) {
// TODO: handle exception
Log.d("Error" e.toString());
return null;

and it's my php :

i require your all of your helps. Thnk u for advance.

210 Viewed this Question

 Recent Replies on "How to solve an error “android Error parsing data org.json.JSONException: End of input at character 0 of”?"

  • Nobody has replied on this post, be first to post answer.

Post Your Solution for this Question

Note: Please Put Code into <code></code> block.

Threads related to "How to solve an error “android Error parsing data org.json.JSONException: End of input at character 0 of”?":

PHP syntax help on if statement

I'm trying to find the right syntax from what I'm trying to do with MySQL. I'm generally saying that if a value in a specific column of a row of a table is equal to little session variables i require to echo out info.I hv a table with subject description and member. member is set by taking the current user's first name and last name and inserting it into the table under member. This is done by the following code snippet snippet:$sql="INSERT INTO tbl_name (subject description user)VALUES('$

How to use explode for three variables

I am saving array in the following way$pos$k = $total$k." / ".$posts_ids$k." / ".$time$k;I am working with following approach to extract the value from the pos array.$a = $b = array();foreach ($pos as $key => $value){ list($a$key $b$key $t$key) = explode('/' $value); array_multisort($a SORT_DESC SORT_NUMERIC $b $t);}But I am not capable to extract the value of the variable $t as well as not capable to sort it without update there position of array.

PHP POST array to table

I new to PHP. I'm trying to make an Incidence of Coincidence (IC) calculator from bits and pieces of code snippet snippet that I hv patched together from other peoples work. it's all working best except for the segment where it is posted to table. i require it to stop making new cells after 50.I hv been searching at it for hours and have tried a some other methods but I hv confused myself. Any Plz Please help me in this?this is my code snippet snippet snippet That is writes the table: if ( $showTable ) { // show tabul

Dynamic url or pages in php

Well it's been my very first initiative to make a dynamic page in php. As I'm a newguy in php i don't know much about php programming. I hv made a database named "dynamic" and it's table name "answer" after that I hv inserted four fields namely 'id' 'A1' 'A2' 'A3'. I inserted the value in id=1 which are A1=1 A2 and A3-0 In id=2 I hv inserted A1=0 A2=1 A3=0In id-3 I hv inserted A1 and A2=0 A3=1So now what i required is whenever i will click on the link of id=1 then it w

How To Echo A Multi Dimensional Array?

I hv string data$data="100 200 300 400|500 600 700 800|900 100 200 300|400 500 600 700|800 900 100 200|300 400 500 600|700 800 900 100";and i require get solution like thisa |b |c |d |100 |200 |300 |400 |500 |600 |700 |800 |900 |100 |200 |300 |. |. |. |. |etc |etc |etc |etc |what I hv to do to get solution like thati new in programming and didnt know about multidimensional arrayall i know i explode this string twice$data = explode(';' $data);foreach($data as &$d) $d=explode(':' $d);

Wordpress how to check how many post available in particular category?

Using cat id How can i checkout how various post available within this category if post is not available then return 0.

why is the following code returning blank page but stil upload photo

heres my page. my problem is why the form returns blank page when i upload a picture. it worked best till i added the last switch statement. the one to generate image. (imagejpeg function) it works when i do without the switch statement. but after i add switch statement the form disappears. so my problem is Where I'm going wrong with the switch statement ? or with the code snippet snippet in total? $imageFile = $_FILES'image''tmp_name'; $filename = basename( $_FILES'image''name'); list($width $height

Compile PHP source code into extension (.so / .dll)

do you know approach to make one of my PHP API libraries compiled into PHP extensions?I don't want my member see the source code snippet snippet of that PHP API.I searched and found the similar BUT with Cython (of Python): How do I protect and compile python source code snippet snippet into a .so library?Thnk u!

Collation type For Portuguese

i require to insert the ( Dvorak International) like text in Portuguese-Brazil language.i set the collation type in database is: utf8_general_cibut it's not working.I am trying to paste it here but here it is showing best.but in database it is not showing in appropriate approach.So Plz tell me which collation is right for Portuguese.My HTML Page char encoding is:

Select common arrays from two mutidimension arrays - PHP

My first array is Array ( 0 => Array ( user_id => 1 name => name1 ) 1 => Array ( user_id => 2 name => name2 ))My Secondarray is Array ( 0 => Array ( user_id => 2 name => name2 ) 1 => Array ( user_id => 3 name => name3 ))The common array is the array with user_id=2 How do I select that array ?i require the intersection of that two arrays.