android studio convert string to json object code example Example: object to json string android Gson gson = new Gson(); String json = gson.toJson(myObj);