Skip to content
Advertisement

Convert object to JSON in Android

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

Advertisement

Answer

Most people are using gson : check this

Gson gson = new Gson();
String json = gson.toJson(myObj);
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement