I have my own custom library apk file (say lib.apk) & i want make it available to other applications. How to provide the uses-library in the android manifest.xml file in other apps so as to use my custom library.
An Android library is structurally the same as an Android app module. It can include everything needed to build an app, including source code, resource files, and an Android manifest.
The <uses-library>
element is for add-ons supplied as extensions to the firmware. AFAIK, it will not be usable for your scenario.
Most likely, you will need to implement a service that exposes an API via AIDL, or uses a set of documented Intent
actions to exchange data with other applications, or exposes a ContentProvider
.
Otherwise, package your code as a JAR, not an APK. You can see many examples of this in my github repositories (all of the cwac- ones follow this pattern).
When converting from a jar library to and apk library make sure that the reference to the jar is removed from "Java Build Path" -> "Projects" and the library is added to "Android" -> "Library".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With