Eclipse: How to import git project as library for Android Project which has to be pushed to Bitbucket

android, dependencies, eclipse, git, project

Solution

Setting your dependency as a library: you'll have to clone the project to a local folder, import it as a project into Eclipse, and in your project configuration you'll have to set the library project as a library: do a right-click in the project's name, go to Properties and under "Android" click in the checkbox "Is library".

Adding the library to the main project: In your main project, go to project properties the same way, and under "Android" click in the "Add" button and add a reference to your library problem.

More details here: http://developer.android.com/tools/projects/projects-eclipse.html

git: if you don't want to put the library's source code into your project you can add it to a .gitignore file and download it manually everytime you clone your project from Bitbucket. You can also take a look at git submodules: http://git-scm.com/book/en/Git-Tools-Submodules . Sorry but I never used them to give you more details.

Problem

Sorry for the long title, here's the jist: - I have a android application project which I'm hosting on bitbucket. - There is a library on github I'd like to add as a dependency. I'm unsure of - How to add the github project as a library to my Eclipse project? - How this will work when pushing/pulling from Bitbucket? Thanks, David.

Original source