Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to parse from this JSONString?
    primarykey
    data
    text
    <p>I get the below <code>JSONString</code> through <code>HTTP Request</code>. And I want all <code>amount</code> values from this String.</p> <p><strong>I tried this so far:</strong></p> <pre><code>try { // Getting JSON Array JSONArray spritPriceArr = jObj.getJSONArray("spritPrice"); int spritPriceArrLength = spritPriceArr.length(); for(int i=0; i &lt; spritPriceArrLength; i++ ){ JSONObject c = spritPriceArr.getJSONObject(i); String amount = c.getString("amount"); System.out.println(amount); } } catch (JSONException e) { e.printStackTrace(); } </code></pre> <p>This works for the first <code>spritPrice Array</code>. But how can I get the <code>amounts</code> of the other <code>spritPrice Array</code> ?</p> <p>I really dont know how to achieve this. Can anyone help me please.</p> <p>This is a link to my full JSON String: <a href="http://www.spritpreisrechner.at/espritmap-app/GasStationServlet?data=%5B%22%22,%22DIE%22,12.949586663166395,48.19435760497557,13.084464736833604,48.28482259502443%5D" rel="nofollow">>>This&lt;&lt;</a></p> <p>[{"kredit":true,"self":false,<strong>"spritPrice"</strong>:[{<strong>"amount"</strong>:"1.329","datAnounce":"2013-11-27 13:05:07","errorItems":[],"errorCode":0,"datValid":1385553907000,"spritId":"DIE"}],"automat":true,"city":"Braunau","open":true,"distance":2.21,"postalCode":"5280","errorItems":[],"priceSearchDisabled":false,"longitude":"13.0365064","payMethod":"Routex","mail":"","gasStationName":"BP","fax":"","clubCard":"","openingHours":[{"beginn":"06:00","day":{"dayLabel":"Sonntag","order":7,"errorItems":[],"errorCode":0,"day":"SO"},"end":"22:00"},{"beginn":"06:00","day":{"dayLabel":"Mittwoch","order":3,"errorItems":[],"errorCode":0,"day":"MI"},"end":"22:00"},{"beginn":"06:00","day":{"dayLabel":"Feiertag","order":8,"errorItems":[],"errorCode":0,"day":"FE"},"end":"22:00"},{"beginn":"06:00","day":{"dayLabel":"Montag","order":1,"errorItems":[],"errorCode":0,"day":"MO"},"end":"22:00"},{"beginn":"06:00","day":{"dayLabel":"Donnerstag","order":4,"errorItems":[],"errorCode":0,"day":"DO"},"end":"22:00"},{"beginn":"06:00","day":{"dayLabel":"Freitag","order":5,"errorItems":[],"errorCode":0,"day":"FR"},"end":"22:00"},{"beginn":"06:00","day":{"dayLabel":"Samstag","order":6,"errorItems":[],"errorCode":0,"day":"SA"},"end":"22:00"},{"beginn":"06:00","day":{"dayLabel":"Dienstag","order":2,"errorItems":[],"errorCode":0,"day":"DI"},"end":"22:00"}],"access":"","url":"","serviceText":"gratis Staubsaugen","maestro":true,"companionship":false,"address":"Salzburger Str. 11","club":false,"errorCode":1,"service":false,"latitude":"48.2546591","bar":true,"telephone":""},{"kredit":true,"self":false,<strong>"spritPrice"</strong>:[{<strong>"amount</strong>":"1.334","datAnounce":"2013-11-27 12:40:18","errorItems":[],"errorCode":0,"datValid":1385552418000,"spritId":"DIE"}],"automat":true,"city":"Braunau","open":true,"distance":2.42,"postalCode":"5280","errorItems":[],"priceSearchDisabled":false,"longitude":"13.048711","payMethod":"Novofleet","mail":"office@fetrading.at","gasStationName":"FE-Trading GmbH ","fax":"4362467223611","clubCard":"","openingHours":[{"beginn":"06:00","day":{"dayLabel":"Montag","order":1,"errorItems":[],"errorCode":0,"day":"MO"},"end":"21:00"},{"beginn":"06:00","day":{"dayLabel":"Donnerstag","order":4,"errorItems":[],"errorCode":0,"day":"DO"},"end":"21:00"},{"beginn":"06:00","day":{"dayLabel":"Dienstag","order":2,"errorItems":[],"errorCode":0,"day":"DI"},"end":"21:00"},{"beginn":"06:00","day":{"dayLabel":"Samstag","order":6,"errorItems":[],"errorCode":0,"day":"SA"},"end":"21:00"},{"beginn":"08:00","day":{"dayLabel":"Sonntag","order":7,"errorItems":[],"errorCode":0,"day":"SO"},"end":"18:00"},{"beginn":"08:00","day":{"dayLabel":"Feiertag","order":8,"errorItems":[],"errorCode":0,"day":"FE"},"end":"18:00"},{"beginn":"06:00","day":{"dayLabel":"Freitag","order":5,"errorItems":[],"errorCode":0,"day":"FR"},"end":"21:00"},{"beginn":"06:00","day":{"dayLabel":"Mittwoch","order":3,"errorItems":[],"errorCode":0,"day":"MI"},"end":"21:00"}],"access":"","url":"<a href="http://www.fe-trading.at" rel="nofollow">http://www.fe-trading.at</a>","serviceText":"","maestro":true,"companionship":false,"address":"Hofer Straße 1 (\" Hofer Parkplatz\")","club":false,"errorCode":1,"service":false,"latitude":"48.244911","bar":false,"telephone":"4362467223634"}]</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload