添加一个大的文本文件,以资产文件夹 [英] Adding a big text file to assets folder

查看:164
本文介绍了添加一个大的文本文件,以资产文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android 2.2应用程序。

I'm developing an Android 2.2 application.

我想一些大的文本文件(4.5MB以上)添加到Android项目。

I want to add some big text files (4.5MB or more) to Android project.

首先,我不知道我是否可以添加这样那样的大文件资产文件夹。但是,如果可以,是否有可能COM preSS呢?

First I don't know if I can add such kind of big files to assets folder. But, if I can, is it possible to compress them?

我怎样才能融为一体preSS文件?和DECOM preSS?

How can I compress files? and decompress?

任何其他更好的方式来大的文本文件添加到Android项目?

Any other better way to add big text files to Android project?

感谢。

推荐答案

文件超过1MB放在资产的文件夹不会从你的应用程序读取(它会抛出一个异常)。这是因为他们得到COM pressed在构建过程中,因此,手机需要大量的资源来uncom preSS他们当上了手机。

Files over 1mb placed in the assets folder won't be readable from your app (It'll throw an exception). This is because they get compressed during the build process, and thus the phone requires substantial resources to uncompress them when on the handset.

我beleive你可以将它们放置在原始文件夹中,在那里他们将不会得到COM pressed或使用AAPT假定一个扩展已经融为一体pressed(见的这里

I beleive you can place them in the raw folder, where they won't get compressed or use an extension that aapt assumes is already compressed (see here)

不过,这不是很好的有一个4.5MB的文本文件uncom pressed坐在APK,它浪费了,可以更好地处理空间。试着想下载在第一次使用的数据,而不是,或拆分文件分成块和以前一样,这样AAPT CAN通讯$ P $建议PSS吧。

However, It's not good having a 4.5mb text file uncompressed sitting in the APK, It's wasted space that could be handled better. Try thinking about downloading the data on first use instead, or splitting the file into chunks as suggested before so that aapt can compress it.

这篇关于添加一个大的文本文件,以资产文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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