什么是从资产的文件夹或SD卡访问文件的differnce [英] What is the differnce between accessing file from assets folder or SD card

查看:182
本文介绍了什么是从资产的文件夹或SD卡访问文件的differnce的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个应用程序,我不得不使用三种不同大小的文件(1MB,5MB,15MB)。我搜索,然后才知道,我们能保持资产的文件夹,这些视频可以使用这些视频。

I am developing an application where I have to use three different size's file (1mb, 5mb, 15mb). I searched, then came to know that we can keep these video in assets folder and can use those video.

其次,我才知道,我们可以把这些影片的资产文件夹和安装时间,我们可以将所有的视频​​到SD卡。当尝试第二种方法所面临的问题,由于较大的文件大小。

Secondly, I came to know that we can keep these videos in assets folder and installation time we can move all videos to SD card. when tried second approach faced problem due to bigger file size.

那么,谁能告诉我什么是两种方法,哪一个我应该使用之间的区别。任何指针将AP preciated。

So, can anyone please tell me what is difference between both approaches and which one I should use. Any pointer will be appreciated.

推荐答案

文件通过1MB放在资产文件夹不会< STRONG>读从您的应用程序的(它会抛出一个异常)

Files over 1mb placed in the assets folder won't be readable from your app (It'll throw an exception).

这是因为他们得到 COM pressed 在构建过程中,因此,手机需要大量资源 uncom preSS 他们当上了手机。

This is because they get compressed during the build process, and thus the phone requires substantial resources to uncompress them when on the handset.

如果在资产 COM pressed ,该系统具有 uncom preSS 整个事情内存。如果你有一个20MB的资产,这意味着物理内存20MB 是捆绑您的应用程序。

If the asset is compressed, the system has to uncompress the entire thing to memory. If you have a 20MB asset, that means 20MB of physical memory is tied up by your application.

我相信你可以将其放在原始文件夹,他们不会得到 COM pressed

I believe you can place them in the raw folder, where they won't get compressed.

编辑:

您可以上传高达 50MB的文件大小APK 到Android市场,这是标准的,它现在以更大的尺寸的 APK的给予支持吧。请参阅下面的参考链接,这样的:

You can upload upto 50MB file sized APK to android market, that is standard and it is now giving support to bigger sized APK's too. See below reference link for this:

Android应用突破50MB障碍

感谢。

这篇关于什么是从资产的文件夹或SD卡访问文件的differnce的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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