Socket.io-client-java: Switching from org.json to JSON.simple

Created on 8 Jul 2015  路  10Comments  路  Source: socketio/socket.io-client-java

For greater compatibility and reduced size of the final binary, I'd advise to switch to the more popular and better maintained JSON.simple Java library.

If it's not a problem, I could fork the repo, implement those changes myself and later make a pull request.

enhancement

Most helpful comment

In my opinion, there are a lot more json libraries out there with better performance than org.json. Why don't you just give user raw data (Strings, Streams ...) so we can freely process the response?

All 10 comments

@mrgame64 Android have default support for org.json and not json.simple. Major user of this lib are of Android Apps only. in my opinion.. its good to keep org.json than json.simple

In my opinion, there are a lot more json libraries out there with better performance than org.json. Why don't you just give user raw data (Strings, Streams ...) so we can freely process the response?

@eneim :+1:

That may be cool if users can use any JSON libraries though an adapter.

hi
json.org is not free
see https://wiki.debian.org/qa.debian.org/jsonevil
yes, sure, Android uses json, but this is a drop-in replacement, under Apache 2.0 license
https://android.googlesource.com/platform/libcore/+/master/json
For Fedora each projects which use the original json library become NOT Free
regards

The definitions of "good" and "evil" are highly debatable... why would someone insert such a clause?

@nkzawa What's the reason for not using gson or another json mapper that provides a POJO instead of dictionary lookup?

@fahimk It's widely used, small but enough feature sets for this library. One of the most important reasons was org.json can have any kinds of values like byte[] in JSONObject. gson couldn't do that.

@nkzawa ok that makes sense. How would you recommend converting to a POJO other than converting back to a String first?

@fahimk I don't know other way :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NotNotMarshall picture NotNotMarshall  路  4Comments

commjoen picture commjoen  路  5Comments

emanuelet picture emanuelet  路  7Comments

jingfreeks picture jingfreeks  路  3Comments

anooj1483 picture anooj1483  路  9Comments