Skip to content Skip to sidebar Skip to footer

It Is Possible To Include Layout And Other Resources In An Android Jar?

I'm building a jar so that other developers can use the view I create in their Android applications. I'm wondering if it is possible to use a layout resource in my jar so I can bui

Solution 1:

No, not currently. Because of the way Android packages resources in an apk, you can't include them in a jar. However, you can still share the jar with the other developers - they'll just have to manually pull in the layout files.

Solution 2:

NO you cannot you will have to specify the layout parameters within your code for the jar to be of use.

Solution 3:

YES you can precompile your xml layout files and put them in the assets/ folder then package them into your jar file, then you can load them using XmlResourceParser and LayoutInflater. Other resource files such as image can also be packaged into jar like this.

Post a Comment for "It Is Possible To Include Layout And Other Resources In An Android Jar?"