将文件复制到文件夹资产 [英] Copy file to assets folder

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

问题描述

搜索1小时后我没有发现有任何解决我的问题。

After searching 1 hour i do not found any solution to my problem.

我想从SD卡资产文件夹移动文件,并覆盖资产文件夹中的现有文件(这两个文件中的SQLite数据库具有相同的名称与数据只是有点差)

I want to move a file from sdcard to assets folder and also overwrite the existing file in assets folder (both file are sqlite database have same name with just a little difference in data )

...

推荐答案

其实, Android的.apk文件的行为是只读这样的目录结构是在apk文件遵循同样的,因此,没有人可以写这个文件或在运行时进行更改,这就是为什么你不能在运行时使 /资源文件夹 A的变化。你可以从中读取文件(手段复制其在资产,任何内部存储可用 / SD卡 但它写到反之亦然)

Actually, The behaviour of the android .apk file is read only so the directory structure which are in that apk file follows the same, So no one can write this files or make changes on that at runtime,that's why You can't make a changes in /asset folder at runtime. you can read file from it (means copy files which are available in asset to any internal storage or /sdcard but not write it to vice-versa)

其应用在所有这是建立的apk文件的目录。根据文档。

Its apply on all the directories which are build in .apk files. As per docs.

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

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