JSON response is changed as no of item changes
<p>my JSON Response from server is changes as user input , suppose on server when user added one item then i got response as JSONObject but when items is more than 1 Then response is in JSONArray form.</p>

<p>Now how to handle these response so that my application is not killed , need to use checkpoint ? </p>

<p>in case of two item ..</p>

<pre><code>"items":{
     "item":[ 
          {
           "item_id":"49623",
           "type":"Products",
           "name":"desktop app",
           "description":"",
           "unit_cost":"162.45",
           "quantity":"1.00",
           "discount":"0.00",
           "discount_type":"Percent",
           "tax1_percent":"0.00",
           "tax2_percent":"0.00"

        },
        {
           "item_id":"52851",
           "type":"Products",
           "name":"",
           "description":"",
           "unit_cost":"5,290.50",
           "quantity":"1.00",
           "discount":"0.00",
           "discount_type":"Percent",
           "tax1_name":{

           },
           "tax1_percent":"0.00",
           "tax1_type":{

           },
           "tax2_name":{

           },
           "tax2_percent":"0.00",
           "tax2_type":{

           }
        }
</code></pre>

<p>]
      }</p>

<p>In case of single item </p>

<pre><code>"items":{
     "item":{
               "item_id":"49623",
                "type":"Products",
                 "name":"desktop app",
        "description":"this  is the software for your desktop system sequerty",
        "unit_cost":"162.45",
        "quantity":"1.00",
        "discount":"0.00",
        "discount_type":"Percent",
        "tax1_name":{

        },
        "tax1_percent":"0.00",
        "tax1_type":{

        },
        "tax2_name":{

        },
        "tax2_percent":"0.00",
        "tax2_type":{

        }
     }
</code></pre>

<p>}
      }</p>
