Search code examples
androidresourcesandroid-assetsshared-directory

How to include a shared asset folder between android projects?


Let's say that I have 2 projects with that use the same images.

All pictures are stored in folders:

/pictures/set1/
/pictures/set2/
/pictures/set3/
/pictures/set4/
/pictures/set5/

Project 1 needs:

/assets/pictures/set1/
/assets/pictures/set5/

Project 2 needs:

/assets/pictures/set2/
/assets/pictures/set5/

Currently: I copy all images to the /assets/ folder. This duplicates my images, and is more difficult to manage after upgrading the images.

Is there a way I can share those images, and only build my app with the resources I need? This without including them in both projects manually?


Solution

  • Is there a way I can share those images?

    yes, put all your images into the asset folder under one project and drag the folder onto "asset" folder name in the other project in eclipse. and click "link to files and folders" if you are asked to make a choice.

    only build my app with the resources I need

    if you use Proguard, it will remove all resources and functions(and lots of stuff) that aren't used in your project