如何将数据文件与我的Andr​​oid APK安装? [英] How to include data files with my Android install apk?

查看:184
本文介绍了如何将数据文件与我的Andr​​oid APK安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要的是安装在我的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);

这篇关于如何将数据文件与我的Andr​​oid APK安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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