Android json error.index out of range
<p>I am trying to get values from mysql and inserting them in sqlite database.But i am getting error in json index out of range.</p>

<p><strong>Here is my code</strong>.
<strong>I am getting json parsing Exception</strong>:</p>

<pre><code>    protected void onPostExecute(Void v) 
     {
        try{
            Database1 db=new Database1(getApplicationContext());

            JSONArray jArray = new JSONArray(result);

            for(int i=0;i&lt;=jArray.length();i++)
              {
                 JSONObject json_data = jArray.getJSONObject(i);

                    // list1.add(json_data.getString("id"));
                            int s=json_data.getInt("id");
                  j=json_data.getString("name");


              db.open();
              db.inserttable1(s,j);

                   Toast.makeText(getBaseContext(),s+j,Toast.LENGTH_LONG).show();

                  }
              }            
            catch(JSONException e)
             {
                    Log.e("log_tag", "Error parsing data "+e.toString());
                }
</code></pre>
