0
有人可以帮助我解决一些关于如何使用android应用中的GSON谷歌库来建立我的Json字符串的方法。如何为WCF REST API生成提及的json格式
我已经使用JsonStringer生成了下面提到的字符串,如下所述。
JSONStringer stringer = new JSONStringer()
.object()
.key("loginRequest")
.object()
.key("UserId").value("007")
.key("Password").value("125987563")
.key("LicenseKey").value("My Project Key")
.key("MobileId").value("This is mobile id")
.endObject()
.endObject();
{"loginRequest":{"UserId":"007","Password":"125987563","LicenseKey":"This is License Key","MobileId":"This is mobile id"}}
请指教,我怎样才能使用Gson生成上述字符串。
感谢