Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I share resources between the different Eclipse projects, so as to avoid duplication?

I have 2 android applications that share 95% of their resources, layouts, strings etc. only a few jpg's are different.

How can I share resources between the different Eclipse Android projects, so as to avoid resource duplication ?

like image 462
user77115 Avatar asked Jul 27 '10 10:07

user77115


2 Answers

Eclipse provides 2 ways to do it,

  1. Create a library project and include this library projects in two application projects
  2. Create a Shared Source Folder, goto your project properties and in Source tab, you can link a folder which may be in any other project and include all files of those folder as a link, without duplicating them.
like image 79
Akash Kava Avatar answered Nov 06 '22 06:11

Akash Kava


I was having trouble figuring this out as well, and these answers didn't provide enough info for me to get code shared across projects (I'm running Eclipse Indigo SR2), so here's what I did:

Create a Java Project to consume the shared resources, say SharedConsumer Create a Java Project that contains the shared resources, say SharedResources Open Project Properties for SharedConsumer, navigate to Java Build Path, Projects tab Click Add... and select SharedResources.

Resources within SharedResources are now all accessible to SharedConsumer as if they were within SharedConsumer.

like image 27
ericsoco Avatar answered Nov 06 '22 05:11

ericsoco