How to serialize Object to JSON?

前端 未结 7 1687
面向向阳花
面向向阳花 2020-11-27 05:49

I need to serialize some objects to a JSON and send to a WebService. How can I do it using the org.json library? Or I\'ll have to use another one? Here is the class I need t

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-27 05:58

    The quickest and easiest way I've found to Json-ify POJOs is to use the Gson library. This blog post gives a quick overview of using the library.

提交回复
热议问题