Java tutorial
//package com.java2s; //License from project: Apache License import android.support.v4.util.ArrayMap; import org.json.JSONException; import org.json.JSONObject; import java.util.Iterator; import java.util.Map; public class Main { public static Map<String, Long> parseLongJsonMap(JSONObject object) throws JSONException { Map<String, Long> map = new ArrayMap<String, Long>(); Iterator<String> keys = object.keys(); while (keys.hasNext()) { String key = keys.next(); map.put(key, object.getLong(key)); } return map; } }