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

  • How to git clone an OpenShift application to Android
  • Eclipse shows error when there are none
  • Cordova Custom Plugin “Arguments to path.join must be strings”
  • Intellij (Android Studio) git integration: Where is .git?
  • Git rev-list not working in Android Studio build.gradle
  • Create a gradle dependency to import from git
    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.

  • Loading Maven dependencies from GitHub
  • Tons of git commits after pulling down a remote branch
  • In Eclipse/EGit is there a way to edit commit message of unpushed/local commit?
  • Error running git“Cannot run program ”git": error=2
  • Source Control in Lotus Domino Designer
  • git eclipse synchronize workspace shows too many incoming changes due to line endings
  • 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: 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.

    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.