Boldijar Paul
Boldijar Paul

Reputation: 5495

LibGDX - importing the default JSON library of JAVA

I just started using the json library of libgdx, but I don't really like it.

Is there a way to work with the clasic java json library?

http://json.org/java/

Upvotes: 0

Views: 274

Answers (1)

noone
noone

Reputation: 19776

First of all I'd advise you to not use the standad JSON library. It is extremely low-level and doesn't offer any kind of convenience. The LibGDX JSON utilities may be a bit hard to use at first, but once you know how they work (reading the code may help understanding its capabilities a lot), they are really powerful and you can convert most classes even without any custom Serializer, because it uses reflection internally.

If you have problems with it, you could ask specific questions on how to do it. Otherwise you might also have a look at other JSON libraries like Jackson which is also available on mobile platforms.

If you don't need all this power and convenience, then you can also use the standard JSON java classes. Just download the classes and copy them in your project. The license allows this:

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software...

You just have to distribute a copy of the license with your software.

Upvotes: 3

Related Questions