7

I was following this question but it doesn't answer my question completely.

What is real advantage of apklib from jar?

Possible answers:

  1. It contains resources

But I can easily put resources to jar file as well

  1. It contains already prepared android classes

But if I open apklib I don't see dex or something other related to android. Even more I see plain sources inside.

So what is real purpose to keep/distribute library in apklib format?

Community
  • 1
  • 1
Eugen Martynov
  • 19,888
  • 10
  • 61
  • 114

1 Answers1

12

But I can easily put resources to jar file as well

No, you cannot, at least not in terms of the Android resource system. Being able to create a JAR (or similar package) that contains Android resources is one of the objective of the new build system that Google is working on at the present time.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • If I open apklib (I'm looking to actionbarsherlock apklib) - the resources there are resources are in xml. So I think whenever I build app with apklib dependency it will recompile sources and resources from lib – Eugen Martynov Dec 21 '12 at 15:55
  • @EugenMartynov: That matches my understanding. `apklib` is a Maven-for-Android construct, IIRC, and I am not a Maven maven. Android code reuse via JARs is perfectly possible, but you cannot put Android resources into a JAR at the present time. – CommonsWare Dec 21 '12 at 15:57
  • Thanks for pointing me out. I've just read this http://developer.android.com/tools/projects/index.html#LibraryProjects and started understanding details more – Eugen Martynov Dec 21 '12 at 16:12