这在Android中,XML或JSON解析性能方面更好? [英] which is better in terms of parsing performance in Android, XML or JSON?

查看:209
本文介绍了这在Android中,XML或JSON解析性能方面更好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新android开发

I am new to android development

我应该用我的Andr​​oid应用程序,XML或JSON?

What should I use for my Android application, XML or JSON?

这是在分析性能方面比较好?

Which is better in terms of parsing performance?

我会AP preciate任何样品code。

I would appreciate any sample code.

推荐答案

JSON是最好的比较XML

JSON is best compare to XML

XML被不太适合的数据交换

XML is not well suited to data-interchange

简单

XML比SGML简单,但JSON比XML简单得多。 JSON具有小得多的语法和更直接地映射到在现代编程语言中使用的数据结构。

XML is simpler than SGML, but JSON is much simpler than XML. JSON has a much smaller grammar and maps more directly onto the data structures used in modern programming languages.

扩展

JSON是不可扩展的,因为它并不需要是。 JSON是不是文档的标记语言,所以,没有必要定义新标签或属性重新present数据在它

JSON is not extensible because it does not need to be. JSON is not a document markup language, so it is not necessary to define new tags or attributes to represent data in it.

互操作性

JSON具有相同的互操作性潜力为XML。

JSON has the same interoperability potential as XML.

公开

JSON是至少为XML作为开放的,或许更是因为它不是在企业/政治标准化斗争的中心。

JSON is at least as open as XML, perhaps more so because it is not in the center of corporate/political standardization struggles.

重量:  由于JSON的语法需要更少的字符,这是在电线上比XML更轻。

Weight: Since JSON syntax requires fewer characters, it is lighter on the wire than XML.

但它仍然依赖于需求!

这篇关于这在Android中,XML或JSON解析性能方面更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆