You'll need to put the data in assets<div><br></div><div><a href="http://stackoverflow.com/questions/4820816/how-to-get-uri-from-an-asset-file">http://stackoverflow.com/questions/4820816/how-to-get-uri-from-an-asset-file</a> </div>
<div><a href="http://stackoverflow.com/questions/4789325/android-path-to-asset-txt-file">http://stackoverflow.com/questions/4789325/android-path-to-asset-txt-file</a>
</div><div><br></div><div>and use getResources().getAssets().open()</div><div><br></div><div>Or you could put the data in res/raw and use getResources().openRawResource()</div><div><br></div><div>.. but res/raw does not support a nested file structure.</div>
<div><br></div><div>Or maybe you could do something crazy with a custom class loader:</div><div><br></div><div><a href="http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html">http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html</a>
</div><div><br></div><div>--Joe</div><div><br><br><div class="gmail_quote">On Mon, Apr 16, 2012 at 8:08 PM, Rolf Lear <span dir="ltr"><<a href="mailto:jdom@tuis.net">jdom@tuis.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all.<br>
<br>
I am having some limited success with the Android testing. I have run in to an issue through which could really use some input from experienced Android developers.<br>
<br>
Are there any on JDOM-interest with some time to spare?<br>
<br>
My issue right now is that the JUnit tests are mostly passing, but a number of them rely on using ClassLoader.getSystemResource(<u></u>"path/to/file.xml") to load resources as a URL.<br>
<br>
It is improtant to keep it as a URL because many of these tests rely on internal DTD's and XSD's, which, in turn mean that when they are processed the input file's URL will be used as a base for a relative location of the DTD/XSD.<br>
<br>
In other words, I need to keep access to these files as a URL....<br>
<br>
But, ClassLoader.getSystemResource(<u></u>...) is returning null on Android.<br>
<br>
I think it is related to <a href="http://code.google.com/p/android/issues/detail?id=10076" target="_blank">http://code.google.com/p/<u></u>android/issues/detail?id=10076</a><br>
<br>
But, I can't find a good way to work around the issue....<br>
<br>
So, If there's some experienced Android developer who can shed some light in to this particular dark place, I would appreciate it.<br>
<br>
For the record, I have a full test-suite available for any Android developers who happen to use eclipse. It fully compiled, loads, and I am running a 'Test' Project on a 4.0.3 emulator.<br>
<br>
I can, in theory, help you bootstrap the environment in your eclipse pretty easily... if needed.<br>
<br>
Rolf<br></blockquote></div></div>