Is there a size limit for LocalShared Objects created on Mobile apps (iOS/Android) with AIR?

倾然丶 夕夏残阳落幕 提交于 2019-12-11 12:02:20

问题


For a mobile app project I am caching lot of data for offline use into the app.

So far I've been using Classic SharedObjects, storing every data in a couple of fat xmls (as strings in SharedObjects). The images are saved through the FileSystem Class.

I'm now wondering if it is good practice or if I should write my xmls in Files rather than Shared Objects.

My SharedObject's size is 3.6 Mo.

Thanks :)


回答1:


In AIR, it is generally recommended (by developers on here and the Adobe forums as well as the occasional Adobe evangelist) that you avoid using SharedObject entirely. It's meant to be used as a way to store files in a browser's temp file directory. With AIR, you are given far more control using the File and FileStream classes.

As for a size limit, the docs state the max size for a SharedObject is 100 kb. That is, as far as I know, a soft limit. It varies based on client, but it should always be around 100 kb. This is one of the main reasons why it is recommended you use the File and FileStream classes - there is no size limit (beyond the 4GB max file size for a 32 bit system, obviously). You also have full control over the location of the object, the life cycle of it, the security of it, etc.

In short, I highly recommend switching to using the File and FileStream classes when using AIR and use SharedObject only when working with a browser-based SWF



来源:https://stackoverflow.com/questions/22966502/is-there-a-size-limit-for-localshared-objects-created-on-mobile-apps-ios-androi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!