Use resources from pre-created JAR in android

Hi,

I am fixing the Android platform. I have successfully included the finished JAR in the platform assembly, and the classes load and work as expected.

My problem is that the JAR itself includes resource files and their use. This is not executed at runtime (ClassLoader.getResource () and ClassLoader.getResourceAsStream ()). I searched the Internet and found that Android only allows resources to be used in package assemblies (.apk) and does not allow JARs.

My question is: How can I use resources with a JAR? Can I create an APK assembly and use it inside it as a JAR? I have all the source and resource files. I am currently designating other platform projects that depend on my JAR:

LOCAL_STATIC_JAVA_LIBRARIES: = my-prebuilt-module-name

and it works. Everything on the left also links resources ...

Thank you so much

+1
source share
1 answer

I think you are looking for a library project . This allows you to import code and resources into multiple Android applications.

+2
source

All Articles