Search Results

Search found 3 results on 1 pages for 'bulan'.

Page 1/1 | 1 

  • How to get maximum/largest value from json object with Android?

    - by blankon91
    I've json string like this: {"GetReportResult":[ {"bulan":"4","total":"2448","type":"CHEESE1K","uang":"8847823"},{"bulan":"4","total":"572476","type":"ESL","uang":"5863408410"},{"bulan":"4","total":"46008","type":"ESL500ML","uang":"234498301"},{"bulan":"4","total":"228985","type":"UHT","uang":"1367172990"},{"bulan":"4","total":"40995","type":"WHP","uang":"235750452"},{"bulan":"5","total":"5703","type":"CHEESE1K","uang":"134929306"},{"bulan":"5","total":"648663","type":"ESL","uang":"6645764498"},{"bulan":"5","total":"49305","type":"ESL500ML","uang":"266817346"},{"bulan":"5","total":"287867","type":"UHT","uang":"1446897805"},{"bulan":"5","total":"51958","type":"WHP","uang":"631994613"},{"bulan":"6","total":"4390","type":"CHEESE1K","uang":"104527773"},{"bulan":"6","total":"443335","type":"ESL","uang":"4540123082"},{"bulan":"6","total":"28462","type":"ESL500ML","uang":"148290912"},{"bulan":"6","total":"213250","type":"UHT","uang":"1197646870"},{"bulan":"6","total":"27049","type":"WHP","uang":"189802525"} ]} I want to get maximum/largest value of bulan, which is 6. How to do that on android?

    Read the article

  • JSON can't read, key reading fail maybe

    - by Abdullah Al Mubarok
    I wonder why I can't read the JSON Object like this : { "1":{"bulan":"Januari","tahun":"2012","tagihan":"205000","status":"Lunas"}, "2":{"bulan":"Februari","tahun":"2012","tagihan":"180000","status":"Lunas"}, "3":{"bulan":"Maret","tahun":"2012","tagihan":"120000","status":"Lunas"}, "4":{"bulan":"April","tahun":"2012","tagihan":"230000","status":"Lunas"}, "5":{"bulan":"Mei","tahun":"2012","tagihan":"160000","status":"Lunas"}, "6":{"bulan":"Juni","tahun":"2012","tagihan":"150000","status":"Belum Lunas"}, "panjang":6 } with my android code like this : try { int length = jobj.getInt("panjang"); for(int n = 0; n < length; n++){ String m = Integer.toString(n) JSONObject row = jobj.getJSONObject(m); String bulan = row.getString("bulan"); String tahun = row.getString("tahun"); String tagihan = row.getString("tagihan"); String status = row.getString("status"); HashMap<String, String> map = new HashMap<String, String>(); map.put("bulan", bulan); map.put("tahun", tahun); map.put("tagihan", tagihan); map.put("status", status); list.add(map); } } catch (JSONException e) { e.printStackTrace(); } It always return nothing, but it works fine if I change the key m to specific key like if String m = "1"; and I can't use JSONObject row = jobj.getJSONObject(n); because getJSONObject() just accept string, not int. is there something wrong with my code?

    Read the article

  • Getting imagename and make link from <img> with jQuery

    - by Bulan
    With jQuery, I want to make all images under a specific path on a site clickable and showing a big image using Fancybox, which is a lighbox variant plugin for jQuery. My small images are located under "images/products/small", the big ones under "images/products/big" and the imagename is always the same The page is showing the image with the following code: <img src="images/products/small/hat.jpg" alt="Nice hat"> What i want is some jQuery script that makes this into: <a href="images/products/big/hat.jpg" class="fancybox"><img src="images/products/small/hat.jpg" alt="Nice hat"></a> Maybe the part with setting class on the link tag can be skipped and just activate fancybox on the element directly with $(elm).fancybox(); I was looking around a bit and it looks like the jQuery functions "attr" and "wrap" might be useful, but with my currently limited jQuery skills I can't really connect the dots.

    Read the article

1