dongyouzhui1969 2016-08-31 07:11
浏览 637

如何压缩JSON

I have a webservice sending a huge JSON text to an Android app. There's about 20000 ID numbers. Unfortunately but perhaps not surprisingly it's timing out.

What options do I have? The easiest one that comes to mind is somehow compressing this data. Is there any way I can do this (PHP webservice, Java Android app) effectively?

Failing that, is there some technique to send JSON in parts? If so, how does that work? At what point is JSON considered too big to send in one part? Thank you

  • 写回答

2条回答 默认 最新

  • dongnianchou7047 2016-08-31 07:17
    关注

    You can use GZIP in php and send as stream to client and then decode data with java in android

    you can use this for gzip in php: GZIP

    and Gzip in Android : GZIP

    评论

报告相同问题?

悬赏问题

  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区
  • ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示
  • ¥15 NAO机器人的录音程序保存问题
  • ¥15 C#读写EXCEL文件,不同编译