Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practice to parse a JSON object on the client in Java & Android

Tags:

java

json

android

In my Android client I want to receive JSON objects from a server. By googling I found a lot of different possibilities how to best parse the InputStream from the Server, but most of them wrote their own parser. Isn't there a library which does this parsing for me? Or how should I best implement it by myself?


1 Answers

Are you kidding me? There are more than a dozen JSON parsers on Java platform, and most work fine on Android (see http://json.org/). Two most commonly recommended choices are Jackson and Gson, and both work nicely to allow you to not only parse and write JSON, but to also bind JSON data directly to and from POJOs.

like image 51
StaxMan Avatar answered Mar 18 '26 12:03

StaxMan