Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export an APK library project, and use it in another Android project

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?

like image 473
TacB0sS Avatar asked Nov 04 '22 23:11

TacB0sS


2 Answers

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

like image 80
Daniel Magnusson Avatar answered Nov 12 '22 11:11

Daniel Magnusson


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...

like image 39
TacB0sS Avatar answered Nov 12 '22 12:11

TacB0sS