0

I have an android project that compiles to library jar for other applications to use. I want to add some functionality that comes from a 3rd party library. I also want users of my library to only have to include one jar (mine).

Is it possible to pack the 3rd party lib jar as part of mine?

iakiak
  • 109
  • 1
  • 11
  • In the end I ended up getting the source code for the 3rd party library and compiled it as part of mine – iakiak Oct 18 '13 at 23:07

3 Answers3

0

If you design an Android application and specify it as an AndroidLibrary to construct your own jar with later, then all you have to do is include the jar in your build path. When you export your jar for Android later, it will include the jars that you have been using inside your library.

If you want to make those calls public from the 3rd party jar, then I'm not sure off the top of my head if you would be able to use those public calls from just your lib. But I don't see why not.

Jay Snayder
  • 4,298
  • 4
  • 27
  • 53
0

You cannot reference jars inside of jars. (well there might be some ways, but I don't think you want to do them) See here.

If you link to an Android project you can reference the jars in that project. If your library android project is exported to a jar, and if you want to use the inner jar's public API, then you have to include it separately.

Community
  • 1
  • 1
Johnny Z
  • 14,329
  • 4
  • 28
  • 35
0

Use Maven, define your libs dependencies in the pom.xml file when your users declare your lib as a dependency they will get everything they need.

Christopher Perry
  • 38,891
  • 43
  • 145
  • 187