如何在 LWUIT 中解析 JSON 字符串
如何在 LWUIT 中解析 JSON 对象,请给我一些示例或一些我可以阅读此内容的链接。假设我有下面给出的对象。 "{'公会': '猩红之地', '地区': '我们', '领域': '凯勒斯特拉兹', '时间戳': 1311860040}"
How to parse a JSON object in LWUIT,give me some example or some link from where i can read this.Suppose i have the objects given below.
"{'guild': 'Crimson', 'region': 'us', 'realm': 'Caelestrasz', 'timestamp': 1311860040}"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Json 示例代码:此代码适用于 json。
您只需替换名称,例如公会替换名称。如果有任何疑问,请询问我。
Json Example Code:This Code will work for json.
you just replace name, for example guild replacing name.If any doubt ask me.
使用 LWUIT JSONParser 并解析 JSON 格式字符串。只需使用最新 LWUIT 1.5 中的 MIDP_IO.jar 即可。
Use LWUIT JSONParser and parser the JSON format string. Just use MIDP_IO.jar from latest LWUIT 1.5 for this.
我能够在我的应用程序中成功使用下面给定链接中提供的示例代码。
http://jimmod.com/blog/2010/ 03/java-me-j2me-json-implementation-tutorialsample/
http://jimmod.com/ blog/2011/09/java-me-j2me-json-implementation-for-array-object/
顺便说一句,最新的 JSON ME 库可以在这里找到:https://github.com/upictec/org.json.me/
I was able to use sample code provided in below given links successfully in my app.
http://jimmod.com/blog/2010/03/java-me-j2me-json-implementation-tutorialsample/
http://jimmod.com/blog/2011/09/java-me-j2me-json-implementation-for-array-object/
BTW, Latest JSON ME library can be found here : https://github.com/upictec/org.json.me/
您可以使用 JSON jar 并将其导入到您的项目中。之后创建一个 JSON 对象,您可以相应地使用该对象的 optString 或 getString 方法来获取值。
You can use JSON jar and and import that in your project. After that create a JSON object and you can use optString or getString methods of that object accordingly to get the values.