Reputation: 856
I have around 49 android apps. All of them have a reference to one library project. Till now, I have been developing on eclipse. Now, I am moving to Android Studio. What's the way to reference a library project in Android Studio?
I tried the answer mentioned in How to include library projects in Android Studio that are stored in a separate git repository?
This actually copies the library project within the app project. So, If i change anything in the library, it will not be reflected in 48 other apps.
Upvotes: 3
Views: 86
Reputation: 69
you can have your library code in git and add it to your application projects as a sub module. so if you modify the library from one project you can push the changes to the library git and then from other application you can pull those changes. it would be better to keep separate branch of library for each application so as not to conflict with the usage on modification.
i have explained the steps to add a git library as a sub module in here: Android Studio, how to add my own git repository as a library project(sub module)?
Upvotes: 0
Reputation: 647
How about creating a library project, then adding it to Bintray and including in your projects dependencies?
Follow this guide up to the point where you'll be able to include your library like this:
repositories {
maven {
url 'https://dl.bintray.com/$DEVELOPER$/maven/'
}
}
...
dependencies {
compile 'groupId:artefact:0.0.1'
}
Then consider sharing it on jCenter / mavenCentral.
Beware, that sharing code privately on Bintray is not free. This solution would be really optimal for opensource library though
Upvotes: 2