We often meet the need to give others the use of our project, in order to be able to block the code, the code is packaged into a jar package for use by third parties, but how can our resource files be used for each other?
In fact, it's not so complicated, let's introduce the specific method
First, set the project you want to encapsulate the jar package as a library file
Right-click the item name--properties--the checkbox you checked.
Second, the most critical step, clean a project!!!
Eclipse Click on the project--clean--on the toolbar above to select the project to determine
Third, the use of Eclipse's export function, the project SRC directory of the source code (note is only the SRC directory source code, if necessary can also add assets directory, other resources we will be provided as a library project to the user) export jar package, And put the jar package into the original Project Libs directory, refresh.
Here I add that the exported jar, inside the object = Findviewbyid (r.id.id_name) of the r.id.id_name and so on, is not changed, if you do not do the first step and the second step to export directly, then R.ID.ID_ The name section becomes the ID value in the R file, such as: Object = Findviewbyid (2114243567).
Iv. Delete the source code under the project SRC
V. Add the Srcjar.jar package to the customer's project (we simply simulate the Jardemo project) and introduce our plugin resource pool project (note that the client project must be in the same directory as the Resource project).
Six. Add the content from the androidmanifest.xml of the plugin repository project to the customer project and you are done!
Note: If there is a call to the project directory in your project called resources, such as assets apk or MP3 files, can be copied to the corresponding directory of the client.
If this method doesn't work, refer to another article
Http://www.codes51.com/article/detail_104939.html
About resource usage issues after exporting jar packages in Android development