It appears that it is not possible to access resources stored on the
classpath within a 3rd party jar file from Android.  Many 3rd party
jars store data and configuration files within the jar itself.  I'm
surprised this doesn't work as it will prevent many 3rd party
libraries from working without major overhauls.  For instance, code
like the following doesn't work:

URL data = this.getClass().getResource(name);

I've read from other posts that the following doesn't work too:

Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);

I understand that jars get converted into dex files?  When this
happens, are only class files retained?  What happens to the
resources?  Is there a way to access those resources?

Luckily, I have source for the jar file I need to use.  Unfortunately,
it uses data resources all over the place, and probably 50% of the
classes will need to be modified.  I'd much rather figure out a way to
access those resources without modifying all the code.

If this can't be solved, then any 3rd party jars that don't provide
source code could not be used in Android until the developer provides
an Android version of the jar.  Is this just the way things work with
Android, or is there a workaround others have found?

Thanks!
Tauren

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to