5

Today my final project setup has an Android library dependency. That Android library dependency project is located in the same workspace as the final project.

I would like to export that library project with its SOURCES and ANDROID RESOURCES, into some archive, jar, apk, apklib, anything that would allow me to add that file as a dependency, and not be forced to include/checkout a project with its sources and resources into the workspace.

I know Maven kinda solve this, but that is not my goal, I'm trying to allow simple Eclipse Android project to be able to add the Android library as a dependency.

(I don't mind using the apklib Maven produces with a non Maven Android project in Eclipse, but I guess that would be meaningless...)

How can this be done?

Jainendra
  • 24,713
  • 30
  • 122
  • 169
TacB0sS
  • 10,106
  • 12
  • 75
  • 118

2 Answers2

1

You can create a "regular" Java project and import from there Android.jar. Then, you will have access to every component in the SDK. Then, you can export your project as jar... and load it from your Android app. This works great and it seems a preety straightforward way to do it.

Create an Android Jar library for distribution

Community
  • 1
  • 1
Daniel Magnusson
  • 9,541
  • 2
  • 38
  • 43
  • @TacB0sS You **can** have resources in the library. Check [this](http://stackoverflow.com/a/17064024/636571) out. – an00b Jul 28 '13 at 02:14
  • @TacB0sS Did you find a solution to export your lib with resources? – Raphael Royer-Rivard Apr 11 '14 at 16:02
  • Unfortunately not... There is a trick however to split your project into two, one only resources, the other only the code. the first you supply fully, with the resources, and the other as a Jar. it seems to work, Google uses it to distribute their libraries, for example play-store api, but unless you have a continues integration this is a hassle to manage! – TacB0sS Apr 11 '14 at 21:01
1

OK Guys,

As far as I've investigated, there is no way to do that. I have to find a solution for this, or my Cyborg distribution would be hell.

I would have to write a script that would do that for me...

If something has changed, and ADT would decide to grow some sense, please let me know...

TacB0sS
  • 10,106
  • 12
  • 75
  • 118