Convert object to JSON in Android

Thizzer picture Thizzer · Apr 6, 2011 · Viewed 147.2k times · Source

Is there a simple method to convert any object to JSON in Android?

Answer

James L picture James L · Apr 6, 2011

Most people are using gson : check this

Gson gson = new Gson();
String json = gson.toJson(myObj);