5

I've been looking at the Android + App Engine source code from a Google IO session (Android meet App Engine). They generate three projects, an Android project, a GWT interface, and an App Engine server project. All of these projects have a common source folder called shared where they can put their synchronized data classes that all parts of the app need to know about.

I'm wondering how to create that shared source folder in a general Eclipse project. How can I create a source folder in one project that's also available to and synced with other projects in Eclipse?

Edit
I'm not looking for how to do an Android Library project (I already use several of those for my apps). Android Libraries don't work for a general eclipse project, say an App Engine server side project.

CodeFusionMobile
  • 14,812
  • 25
  • 102
  • 140

2 Answers2

5

I am using Helios eclipse.

To create Source Folder

Navigate to your project in the package Explorer, right-click and select New, select Source Folder. Enter the folder name and click Finish.

If you want to use the source folder in any of your projects, then go to your project properties, click Java Build Path, go to Source tab, you can link the folder.

Foggzie
  • 9,691
  • 1
  • 31
  • 48
Sunil Kumar Sahoo
  • 53,011
  • 55
  • 178
  • 243
  • See [This question](http://stackoverflow.com/questions/6189426/how-to-create-shared-source-folder-across-multiple-projects-in-eclipse) for how to make a relative link to another project folder. – Glenn Sep 25 '14 at 21:57
0

The way to do this within Android is through use of a library project. Create one project as an Android library (properties->android->Is Library gets checked), and the others must have their property page updated to make use of the library.

Libraries have their code and resources pulled into projects that use the library. The library's manifest is ignored.

mah
  • 39,056
  • 9
  • 76
  • 93
  • I know how to do this with a Library project, in fact I use a couple of them. My question is how to do this generally in Eclipse. Say I have a server and client side version, both need to have a common serializable class. I know there's a way to create a shared source folder like this. – CodeFusionMobile May 31 '11 at 15:03
  • I see. You might edit your question to remove the Android tag since you really mean !Android. – mah May 31 '11 at 15:36