Benefits of Parseable over JSON

I am currently using JSON (org.json) to serialize one of my data classes. When I pass it to the Bundle or with intent, I simply call .toString () on the sender side, and then recreate the class on the receiving side. Of everything I've read so far, I should not implement Java Serializable due to performance issues. I am rewriting some parts of the application, and I have been considering the possibility of creating data classes for Parcelable and transferring them this way. What would be the benefits if I did it this way? Would it be preferable if I used the Jackson JSON library? Most JSON work is based on the API; the server responds only with JSON. I also store some JSON for caching on the application side.

+5
source share
1 answer

I think JSON is by far the most convenient mechanism for typical POJOs; and it seems unlikely that performance should be significantly worse than when using Parcelable. A possible implementation may be more compact; but if this is problematic, you can even compress cached JSON files. So I will probably try JSON first and see how it works.

+7
source

All Articles