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

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

  • Integrate Visual Studio online Git Repository to Android Studio 1.0.2
  • 'Android Pre Compiler' error 'Path must include project and resource name'
  • what folders should git ignore in an Android project
  • How to use git branch with Android Studio
  • Gradle module and git submodule
  • Error running git“Cannot run program ”git": error=2
    1. How to add the github project as a library to my Eclipse project?
    2. How this will work when pushing/pulling from Bitbucket?

    Thanks, David.

  • Eclipse, Git - Keyboard Shortcut, How to use?
  • Integration-Manager Git Workflow using Jenkins/Hudson
  • Eclipse Git plugin - remove file from repo without deleting local
  • Need help understanding the Git icons in Eclipse
  • Eclipse + Git - what does “staged” mean?
  • Where to git init for Java project?
  • 2 Solutions collect form web for “Eclipse: How to import git project as library for Android Project which has to be pushed to Bitbucket”

    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:

    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: . Sorry but I never used them to give you more details.

    If the library is a .jar file, you can simply paste it into the libs folder of your app. Android should automatically add it to the build path. As far as pushing/pulling from BitBucket goes, as long as you add the .jar file in git the library will be committed like any other file.

    Git Baby is a git and github fan, let's start git clone.