Android how to get access to raw resources that i put in res folder?

Arkaha picture Arkaha · May 18, 2010 · Viewed 119.2k times · Source

In J2ME, I've do this like that: getClass().getResourceAsStream("/raw_resources.dat");

But in android, I always get null on this, why?

Answer

Samuh picture Samuh · May 18, 2010

For raw files, you should consider creating a raw folder inside res directory and then call getResources().openRawResource(resourceName) from your activity.