Today, for some reason, to receive a task, we need to merge two versions originally released in the form of two APK packages. Because of their complementary functions, we hope to merge these two projects into one project. After carefully sorting out the ideas, I decided to integrate an APK package close to the underlying service into a jar package!
I thought I had to manually export the jar and then reference it. Later I found that eclipse already has this function, as long as we directly reference it in the function properties. Project-> properties-> Android, there is a library option in the lower right corner. We only need to add the project we want to include. Here, of course, IDE will only prompt the names of the projects that serve as libraries, so we need to do a little work on another project. is to set it to library. the specific method is the path project-> properties-> Android, but this time we need to check it in the is library, this project will be considered to be provided as a library! Well, the basic combination framework has been completed. The following describes how to integrate the content. Because the two projects are originally independent APK, therefore, it will contain their respective resource files and some project-related files. Here we only need. the content in XML can be transplanted. Program Related part Declaration, we need to integrate it into our target project, the specific practice is of course only copy, modify. I believe you understand this: At last, the manifest shown in the manifest file in the library will have only this box left: <? XML version = "1.0" encoding = "UTF-8"?> <Manifest xmlns: Android = "http://schemas.android.com/apk/res/android" Package = "com. avtest"> <Application/> </Manifest> In this way, our project will be completed: the pipeline image, then its approach is to find that this situation is dominated by the target project, directly ignoring the resource file in the library. Therefore, we recommend that you set a set of rules for naming these resources during library development to prevent duplicate names! The last small problem I encountered was that when I signed the final APK package, many. xml files reported Not well-formed (invalid token) The error, this problem also plagued for a period of time, although I know it should be a problem of file format, but when I set the character encoding of the two projects to UTF-8 still can not, the last step is to set it in WINDOW> preference> workspace> text file encodeing. Finally, we are done!