Hi all
I can't seem to reach assets.
I'm creating unit tests for parsing of data that is returned from server. So I wanted to create several xmls and use them in tests (instead of going to server).
I've put an xml file in [project_root]/assets directory and tried to get it with:
but I'm getting the "file not found" exception.
I tried to list assets using
but I was only getting several files and dirs from the root of my project (among which there was "assets" directory). Then I listed "/assets" path, but it was empty...
Any ideas??
P.S. I also tried putting the file in [project_root]/res/raw directory, and then get it with openRawResource(R.raw.test_response1), but I only got null pointer exception...
I can't seem to reach assets.
I'm creating unit tests for parsing of data that is returned from server. So I wanted to create several xmls and use them in tests (instead of going to server).
I've put an xml file in [project_root]/assets directory and tried to get it with:
Code:
getContext().getAssets().open("test_response1.xml");
I tried to list assets using
Code:
getContext().getAssets().list("/");
Any ideas??
P.S. I also tried putting the file in [project_root]/res/raw directory, and then get it with openRawResource(R.raw.test_response1), but I only got null pointer exception...