androidjava-meresourcesinputstreamandroid-resources

How to get access to raw resources that I put in res folder?


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

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


Solution

  • InputStream raw = context.getAssets().open("filename.ext");
    
    Reader is = new BufferedReader(new InputStreamReader(raw, "UTF8"));