tags:

views:

40

answers:

2

In a typical Android project you have the res/drawable directories where you can put images but i have some special custom binary files.

where do I usually put them and can i access them via the R-class then?

A: 

For such type of resources use res/raw directory.

Konstantin Burov
+4  A: 

Either in res/raw or res/assets. Read more in the Android docs.

About files in res/raw:

Arbitrary files to save in their raw form. Files in here are not compressed by the system. To open these resources with a raw InputStream, call Resources.openRawResource() with the resource ID, which is R.raw.filename.

However, if you need access to original file names and file hierarchy, you might consider saving some resources in the assets/ directory (instead of res/raw/). Files in assets/ are not given a resource ID, so you can read them only using AssetManager.AssetManager.

Yoni Samlan
thanks, but this raw directory is not generated in a default eclipse project, right?
clamp
Nope; just create it in the /res/ folder and it'll be handled correctly by the build tools.
Yoni Samlan