Today, I had a huge Json in my app and I wanted to fetch all these values in a general way. I also wanted to parse Json for only one time to avoid try/catch each time I access any value. So, first thing I had in mind was to convert the JSONObject in the HashMap or Map<> etc. So if you are using Gson in your apps for json mapping, then you can use this one line code for conversion.

Continue reading

Author's picture

Wajahat Karim

Android Developer. Open Source Contributor. Writer. Speaker

Senior Android Developer

Karachi, Pakistan