Alex
Alex

Reputation: 419

Use the class in several projects (Eclipse)

I am going to use one class in several Android projects. After importing namespace of the class the second app became being installed with the parent app. Is there a way to prevent such behavior? How should I set up projects in Eclipse?

Upvotes: 0

Views: 53

Answers (2)

Alex
Alex

Reputation: 419

So the complete answer is the following: 1) The class should be put to a separete project which should be marked as a Library Project. 2) To use the class in other projects the created library should be choosed in Properties -> Android as described here: http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject

Upvotes: 0

Raghav Sood
Raghav Sood

Reputation: 82543

Move all the code you need in multiple apps into a separate project, and mark it as a Library Project by right clicking on the project, going to Properties -> Android and checking the Is Library option.

Then simply include it as a Library in your other projects.

Upvotes: 1

Related Questions