问题描述
我如何可以指示Eclipse从我的Android解决方案的文件复制到模拟器,为运行/调试的一部分吗?我有一个小的数据库,存储的资产,需要陪伴的应用程序。到目前为止,我已经简单地复制自己使用DDMS,但会preFER,系统将自动包含该文件。该项目属性允许我指定生成的某些方面,例如构建顺序,哪些库应包括在内,但我没有看到简单地复制一个文件什么。
How can I instruct Eclipse to copy a file from my Android solution to an emulator, as part of Run/Debug? I have a small database, stored in Assets, that needs to accompany the application. Thus far I have simply copied the file myself using DDMS but would prefer to have it automatically included. The project properties allow me to specify some aspects of the build, e.g. the build order and which libraries should be included, but I don't see anything about simply copying a file.
推荐答案
使用的类或者通过签署的apk安装?
Is the file in your "res/assets" folder not available using the AssetManager class during testing versus during testing or when installed via a signed apk?
我用我存储在RES /生在我的比赛之一,我可以只使用正常调用context.getResources()没有问题与Eclipse测试过程中访问此文件大文件。 openRawResource()
I use a large file that I store in "res/raw" in one of my games, I am able to access this file during testing with eclipse without a problem just using the normal calls to context.getResources().openRawResource()
部署与应用程序的数据库是一个反复出现的主题了,在 Android的开发者谷歌集团一> 这里是一个后,并就此事的一些想法。
Deploying databases with your application it a reoccurring topic over in the android-developers Google group here is a post with a few thoughts on the matter.
祝你好运。
这篇关于包括通过Eclipse的Android应用程序的数据库文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!