title: Error parsing data org.json.jsonexception end of input at character 1 of
body: <p>I'm new to android development and I built an android application according to this tutorial... <a href="http://www.youtube.com/watch?v=0TulTqQM0Cc" rel="nofollow">Android Tutorial 22 - JSON Array data display in ListView using ArrayList with custom class </a></p>
  
  <p>I've done everything that the tutorial says but when I run the emulator I receive the following message:</p>
  
  <blockquote>
    <p><strong>error parsing data org.json.jsonexception end of input at character 1 of</strong></p>
  </blockquote>
  
  <p>Here is the code:</p>
  
  <pre><code>public class Antallaktika extends Activity {
  
  ArrayList&lt;proionta&gt; arrayOfWebData = new ArrayList&lt;proionta&gt;();
  
  class proionta {
      public String product_name;
      public String product_sku;
      public String product_price;
  }
  
  FancyAdapter aa=null;
  
  static ArrayList&lt;String&gt; resultRow;
  
  public void onCreate(Bundle savedInstanceState) {
      try{
          super.onCreate(savedInstanceState);
          setContentView(R.layout.antallaktika);
          String result = "";
  
      try{
          HttpClient httpclient = new DefaultHttpClient();
          HttpPost httppost = new HttpPost("http://machina.gr/antallaktika2.php");
          HttpResponse response = httpclient.execute(httppost);
          HttpEntity entity = response.getEntity();
          InputStream webs = entity.getContent();
  
          try{
              BufferedReader reader = new BufferedReader (new InputStreamReader(webs, "ISO-8859-1"),8);
              StringBuilder sb = new StringBuilder();
              String line = null;
              while ((line = reader.readLine()) != null) {
                  sb.append(line = "\n");
              }
              webs.close();
              result=sb.toString();
          }
          catch (Exception e){
              Log.e("log_tag", "Error converting result "+e.toString());
          }
      }
          catch(Exception e){
              Log.e("log_tag", "Error in http connection "+e.toString());
          }
      try{
          JSONArray jArray = new JSONArray(result);
          for(int i=0;i&lt;jArray.length();i++){
              JSONObject json_data = jArray.getJSONObject(i);
              proionta resultRow = new proionta();
              resultRow.product_name = json_data.getString("jos_vm_product.product_name");
              resultRow.product_sku = json_data.getString("jos_vm_product.product_sku");
              resultRow.product_price = json_data.getString("jos_vm_product_price.product_price");
              arrayOfWebData.add(resultRow);
          }
      }
      catch(JSONException e){
          Log.e("log_tag", "Error parsing data "+e.toString());
      }
      ListView myListView = (ListView)findViewById(R.id.myListView);
      aa=new FancyAdapter();
      myListView.setAdapter(aa);
      }
      catch (Exception e){
          Log.e("ERROR", "ERROR IN CODE: " + e.toString());
          e.printStackTrace();
      }
  }
  
  class FancyAdapter extends ArrayAdapter&lt;proionta&gt; {
      FancyAdapter() {
          super(Antallaktika.this, android.R.layout.simple_list_item_1, arrayOfWebData);
      }
  
      public View getView(int position, View convertView, ViewGroup parent) {
          ViewHolder holder;
          if (convertView==null){
              LayoutInflater inflater=getLayoutInflater();
              convertView=inflater.inflate(R.layout.customgrid, null);
              holder=new ViewHolder (convertView);
              convertView.setTag(holder);
          }
          else{
              holder=(ViewHolder)convertView.getTag();
          }
          holder.populateFrom(arrayOfWebData.get(position));
          return(convertView);
      }
  }
  
  class ViewHolder{
      public TextView product_name=null;
      public TextView product_sku=null;
      public TextView product_price=null;
  
      ViewHolder(View customgrid) {
          product_name=(TextView)customgrid.findViewById(R.id.product_name);
          product_sku=(TextView)customgrid.findViewById(R.id.product_sku);
          product_price=(TextView)customgrid.findViewById(R.id.product_price);
      }
      void populateFrom(proionta r){
          product_name.setText(r.product_name);
          product_sku.setText(r.product_sku);
          product_price.setText(r.product_price);
      }
  }
  
  }
  </code></pre>
  
  <p>and the php file is: </p>
  
  <pre><code>&lt;?php
  
  $databasehost = "localhost";
  $databasename = "xxxxxxxxxxx";
  $databaseusername = "xxxxxxxxxxxxxx";
  $databasepassword = "xxxxxxxxxxxxx";
  
  $con = mysql_connect($databasehost,$databaseusername,$databasepassword) or die(mysql_error());
  mysql_select_db($databasename) or die(mysql_error());
  
  $query = ("SELECT jos_vm_product.product_name, jos_vm_product.product_sku, jos_vm_product_price.product_price
  FROM jos_vm_product, jos_vm_product_category_xref, jos_vm_product_price
  WHERE jos_vm_product_category_xref.category_id=2 
     AND jos_vm_product_category_xref.product_id= jos_vm_product.product_id
     AND jos_vm_product.product_id=jos_vm_product_price.product_id
  ORDER BY jos_vm_product.product_name");
  $sth = mysql_query($query);
  
  if (mysql_errno()) {
  header("HTTP/1.1 500 Internal Server Error");
  echo $query. '\n';
  echo mysql_error();
  }
  else
  {
  $rows = array();
  while($r = mysql_fetch_assoc($sth)) {
      $rows[] = $r;
      }
  print json_encode($rows);
  }
  ?&gt;
  </code></pre>
  
  <p>please can anyone help me?</p>