How to transfer Downloaded JSONArray to a Database?
<p>Thanks a lot for the previous response to my query
I have the JSONArray in buffer.I might be wrong when i say these things,so do correct me.</p>

<blockquote>
  <p>public void get_data(String data)
      {</p>
</blockquote>

<pre><code>    try {
        JSONArray data_array=new JSONArray(data);

        for (int i = 0 ; i &lt; data_array.length() ; i++)
        {
            JSONObject obj=new JSONObject(data_array.get(i).toString());
            String[] nameArray;
            String[] distArray;
            String[] latArray;
            nameArray[i] = (data_array.getJSONObject(i).getString("rtrname"));
            distArray[i] = (data_array.getJSONObject(i).getString("ctgname"));
            latArray[i] = (data_array.getJSONObject(i).getString("rtrphone"));
            //lonArray[i] = (data_array.getJSONObject(i).getString("longitude"));


        }

        //adapter.notifyDataSetChanged();

    } catch (JSONException e) {
        e.printStackTrace();
    }
</code></pre>

<p>Now instead of transferring this data to nameArray[i] and so and so,what should i do to transfer this to a Database(SQLite).Ive already created a DBHlper.java class to deal with it,but im new to this and im missing something.</p>

<blockquote>
  <p>public boolean insertData(String rtrname, String ctgname,String rtradd1) {
          SQLiteDatabase db = this.getWritableDatabase();
          ContentValues contentValues = new ContentValues();</p>
</blockquote>

<pre><code>    //contentValues.put(COL_2,rtrphoneno);
    contentValues.put(COL_2,ctgname);
    contentValues.put(COL_3, rtrname);
    contentValues.put(COL_4, rtradd1);
    long result = db.insert(TABLE_NAME,null ,contentValues);
    if(result == -1)
        return false;
    else
        return true;
</code></pre>

<p>1)What should i do in the main class so that i can get each JSONArray node be transferred to the Column of the table??</p>