views:

1845

answers:

2

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.

+7  A: 

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?

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()

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.

Good luck.

snctln
Looks like I should have been storing the file in res/raw, rather than assets. Thanks!
fatcat1111
Glad I could help
snctln
A: 

I have recently developed a database app and now just need to deploy it on a device.I haven't got my db file in any folder in eclipse. Now how can i deploy/install my database on the device? Whats the procedure? Any clue?

Maxood
Hi Maxood this should be a separate question. Stackoverflow is not organized in the typical discussion board way. Either post content like this in a comment or ask a separate question.
Janusz