Code example for JSONObject

Methods: getInt

0
        } 
    } 
     
    static public int getInt(JSONObject obj, String key, int def) {
        try { 
            return obj.getInt(key);
        } catch (JSONException e) {
            return def;
        } 
    } 
     
    static public boolean getBoolean(JSONObject obj, String key, boolean def) {
        try { 
            return obj.getBoolean(key);
        } catch (JSONException e) {
            return def;
        } 
    } 
     
    static public double getDouble(JSONObject obj, String key, double def) {
        try {