包括通过Eclipse的Andr​​oid应用程序的数据库文件 [英] Include a database file with Android application via Eclipse

查看:128
本文介绍了包括通过Eclipse的Andr​​oid应用程序的数据库文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何可以指示Eclipse从我的Andr​​oid解决方案的文件复制到模拟器,为运行/调试的一部分吗?我有一个小的数据库,存储的资产,需要陪伴的应用程序。到目前为止,我已经简单地复制自己使用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.

推荐答案

使用的在测试过程中对测试过程中AssetManager 类或者通过签署的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测试过程中访问此文件大文件。<一个href="http://developer.android.com/reference/android/content/res/Resources.html#openRawResource%28int%29"相对=nofollow> 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的开发者谷歌集团 <一href="http://groups.google.com/group/android-developers/browse%5Fthread/thread/e7857f4eaf2856fd/b18ed9f9a6b9072a?lnk=gst&"相对=nofollow>这里是一个后,并就此事的一些想法。

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的Andr​​oid应用程序的数据库文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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