Is it possible to create a custom library in Android (having its own layout resources) for use across several Android applications?
I created a regular *.ja
Well, I think there is a way to do it (although I didn't try it myself), but it requires the users of your library having to build their APKs manually via aapt.
The problem is this: The JAR you're exporting contains the R class file which holds the resource IDs of your library. So, any application can access these IDs by simply linking your JAR. However, that's not enough, because by default, only resources in the app's res/ folder are bundled with the APK. Hence, you have to create the APK yourself using aapt, telling it to also include any resources from your library. Check the aapt tool help for more information.
Since this implies that users of your library have to introduce a manual build process (or at least modify it), it makes for a poor experience.