如何将数据文件与我的Andr​​oid APK安装?我的、如何将、文件、数据

2023-09-12 09:32:41 作者:男生与女生在游戏里取名字是有区别的,男生偏爱搞笑个性的名字,

我要的是安装在我的Andr​​oid应用程序时,安装一些pre-创建的文件。我想安装该文件同时在内部存储器(数据/数据​​//文件/)和新创建的SD卡目录(/ SD卡//数据1 /)

I want to install some pre-created files when my Android application is installed. I would like to install the file in both the internal memory (data/data//files/) and in a newly created sdcard directories (/sdcard//data1/)

我知道这是可以做到的,但我的搜索已经变成了什么都没有。

I know this can be done but my searches have turned up nothing.

请帮忙。

推荐答案

您可以保存在 \水库\原始文件和写入code存储此文件到所希望的位置,如果它时,应用程序启动不存在。 检查这来访问内部存储器和SD卡 并使用访问文件以下

You can save you files in \res\raw and write the code to store this files to the desired locations if it does not exist when the app start. Check this to access the internal memory and sdcard and access the raw file using the following

InputStream databaseInputStream = getResources().openRawResource(R.raw.yourfile);