如何将数据文件与我的Android APK安装? [英] How to include data files with my Android install apk?
问题描述
我要的是安装在我的Android应用程序时,安装一些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);
这篇关于如何将数据文件与我的Android APK安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!