Take the 2-minute tour ×

What is the android way of distributing | deploying libraries? Say you have library called L1, and two apps called A1 and A2. Both apps use L1.

It wastes space to include L1 in both A1's and A2's apk.

  • one can make a separate APK for L1. How can A1 and A2 use (link / include / import / refer to) it?

creating a separate APK for the lib introduces an unwelcome install dependency. It is harder now to install both A1 and A2. The user may need to install the dependency separately which is unwelcome. How to solve this?

  • Is there a better way, so L1 gets automatically installed for the first time, but if it's already available, then it is not installed anymore?
    • one way to do this is when installing A1 or A2, they download L1 on demand (when needed). Is this a good idea and is there a recommended way to do it?
    • another way is to include L1 in both A1 and A2, but only actually install it if it's not already installed. How to do this?

I've seen How to ship library for Android but the links are old and so it didn't help me. Also tried How to distribute an Android Library but it was just about a technical difficulty.

I'm interested in both a purely technical way to do this (no market/play integration for the time being), and information if this is compatible and if recommended with market/play or not.

share|improve this question

Your Answer



Browse other questions tagged or ask your own question.