About resource usage issues after exporting jar packages in Android development

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.