问题
Can an Android APK archive be imported into another Android project and accessed the same way as a JAR archive can?
回答1:
No not in the way you would use a jar. If you have a java library that you want to import into your project you can simply add it as in any other java project.
If you have the project files of an app that you want to integrate in you application you can create an android library project out of this app. This enables you to build a R file for the layout objects and drawables etc. of the library that is also consistent in the project that includes this library project.
回答2:
I think that you actually can at runtime (assuming read permissions) but you cannot resolve imports at the java compilation stage since you don't have any java class files, only dex class files that were made from them. So you'd need java stubs or "headers" to stand in for those functions during the java stage of compilation - or possibly try to "link" to them manually at runtime using reflection.
来源:https://stackoverflow.com/questions/3658386/import-android-apk-archive