Skip to content

Instantly share code, notes, and snippets.

View piyush-malaviya's full-sized avatar

Piyush Malaviya piyush-malaviya

  • Ahmedabad, Gujarat, India
View GitHub Profile
@piyush-malaviya
piyush-malaviya / JsonUtils.java
Created April 13, 2017 11:36
JsonUtils, JSON parsing made easy. Simply pass the json object and the path to the key you want, and it will return value if available, otherwise it will return null. Works well with simple JSONObject and Gson's JsonObject.
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Iterator;
import java.util.Map;
public class JsonUtils {