Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharing resources between projects

I have many projects that have an identical activity which include identical drawable resources. In each project I have duplicated the src java file, the layout xml file and the drawable images. Ideally I'd like to be able to have one set of these and somehow share them to the other projects. Shared folders appear to be the way to go but after setting them up I cannot figure how to reference the linked files.

Lets say, to keeps things simple, I have two projects, a Source project which contains the java code file, the layout file, and a drawable folder containing all the images I require. The second project lets call it Destination.

In Destination I create the linked folder called "linked" to the drawable folder in Source which is then viewable in explorer. In my layout xml, how can I reference the "linked" folder and then the individual images for the SRC of imageviews?

Would it also be possible to link my identical activities java source and xml files in the same manner?

If there is another or better way to accomplish this I'd be grateful for some pointers.

thanks

like image 460
Mark Avatar asked Oct 20 '22 20:10

Mark


1 Answers

I think you should package your common code and resources into a library and then use this library inside all yours projects.

like image 148
k3v1n4ud3 Avatar answered Oct 24 '22 01:10

k3v1n4ud3