本文介绍了有没有大小限制的移动应用程序(的iOS / Android的)与AIR创建LocalShared对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于移动应用程序项目,我缓存大量离线使用数据到应用程序。

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

到目前为止,我一直使用的是经典共享对象,存储在一对夫妇的脂肪XMLS的每个数据(如字符串共享对象)。这些图像是通过FileSystem类保存。

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.

我现在想知道,如果它是很好的做法,或者我应该写我的文件XMLS而不是共享对象。

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

我的共享对象的尺寸为3.6莫。

My SharedObject's size is 3.6 Mo.

感谢:)

推荐答案

在AIR中,通常建议(通过在这里开发人员和Adobe论坛以及偶尔的Adobe布道者)避免使用共享对象完全。它的意思是被用来作为一种方法来存储在浏览器中的临时文件目录中的文件。通过AIR,您将得到更加控制使用文件的FileStream 类。

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.

至于大小限制,该文档说明了共享对象为100 KB的最大尺寸。也就是说,因为据我所知,一个软限制。它变化的基础上的客户端,但它应该永远是100 KB左右。这是主要的原因之一,建议您使用文件的FileStream 类 - 没有大小限制(超出最大4GB的文件大小为32位系统,很明显)。你也可以完全控制的对象,它的生命周期,它的安全性等的位置。

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.

总之,我强烈建议使用空当切换到使用文件的FileStream 类,并使用共享对象只有的一个基于浏览器的SWF工作时

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

这篇关于有没有大小限制的移动应用程序(的iOS / Android的)与AIR创建LocalShared对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 21:04