Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

State of Android project dependency management

We are standardizing our infrastructure for Android development and we are trying to incorporate dependency management to our Android library projects. My current track is using the maven android plugin with m2e-android. We have uploaded the Android artifacts to our Artifactory repository with the Android SDK Deployer. We also have an internal framework with a few libraries we can import into our projects and for most part it works fine.

The issue we are facing now is that apklib dependencies containing resource files are hard to set up. The maven plugin can correctly configure the classpath but if the apklib has resource files that needs to be referenced by the parent Android project, Eclipse is unable to find them unless you checkout the Library Project and link it to the parent project through ADT.

After reading m2e-android discussion on issue https://github.com/rgladwell/m2e-android/issues/8, https://stackoverflow.com/questions/6269816/creating-closed-source-android-libraries#answer-6270768 and APKLIB does not get installed in Maven Repo, I'm not convinced maven is the way to go until ADT properly support closed source apk libraries.

I'd like to know how are you handling these kind of dependencies on your Android projects. What strategies are there other than using Maven?

For reference, here's what we have tried so far.

  1. No dependency management. All required jars are stored into the lib folder and pushed to the source control repo. Library projects are set up as subfolders and pushed to the source control repo for each project they are used in. Eclipse project settings are also pushed. Project built with standard ADT Ant script.
  2. Jar dependencies into libs folder and library dependencies as git submodules. Project built with standard ADT Ant script.
  3. Dependency management with maven, including library projects with apklib packaging. Issue with resource files in apklibs.
like image 370
AngraX Avatar asked Jan 14 '13 20:01

AngraX


People also ask

What is the dependency manager for Android?

In Android side, things are simpler, as it's main IDE Android Studio is actually IntelliJ that has uses Gradle as it's dependency management within. No additional installation is needed, nor setup. Once you setup the Android project, your Gradle file is all setup accordingly.

What are dependencies in Android?

In Android Studio, dependencies allows us to include external library or local jar files or other library modules in our Android project. For example: Suppose I want to show some images in ImageView. But I'm using Glide Library to enhance the smoothness of application.

Where are the dependencies in Android Studio?

Go to File > Project structure in Android Studio. Select the app module in the Modules list on the left. Select the Dependencies tab.


1 Answers

You can have an insight on how Facebook Android developers address their dependencies issues in this video: How Facebook Built Facebook for Android.

They use Buck for that. Buck is a build system for Android that encourages the creation of small, reusable modules consisting of code and resources. Buck is in github

This might not be the best solution for you but maybe for someone else.

like image 192
JuanMa Cuevas Avatar answered Sep 22 '22 00:09

JuanMa Cuevas