SyntaxFix
Write A Post
Hire A Developer
Questions
Non of them worked for me. I did this and it worked:
To encode as a json:
JSONObject obj = new JSONObject(); obj.put("productId", 100);
To decode:
long temp = (Long) obj.get("productId");