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.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I try to use a jar library in eclipse (I added an external jar library in the Java Build Path options of my project). The application compiles but I have a "Could not find class..." exception at runtime.
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 aContentProvider
.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".
You can actually make a project that links to another project.
You have to do two things in Eclipse:
But i haven't managed to make it run. The sdk correcly uploads both packages, but I get an link error
The VM cannot load the class in my app that links into the libs app.
The lib.apk "application" should publish intents using
Intent-Filters
in the AndroidManifest.xml file.The activity which requires to use the activity within the lib.apk, just needs to start an intent like below :