A project with a res resource file needs to be made into a jar package for others to use a workaround

Source: Internet
Author: User

For example, their own finished project, the name is MyObject, need to export into jar package, let others project call, but their project also contains pictures, layout layouts, libs inside of the dependency package and so on;

Steps:

1.MyObject project needs "is library", as a class library. (Project right-properties-android page lower Library section select "Is Library", click OK on the line)

2. Create a new project, the name is random, I called mylib,packagename must be the same as the MyObject project. Then it is the "is library", and then the mylib inside the res and SRC directory deleted, no use

3.MyObject project "Clean" a bit, Then his bin directory will have a Myobject.jar file, copied to the Libs directory of the Mylib project, copy the Res folder of the MyObject project to Mylib, including the third-party jar or class library under the MyObject folder of Libs project, and copy to Myli b in the Libs directory, this time the new class library file is basically done, but, not directly to others, before use, there are important three steps

1. When using this mylib, the "Add Library" is required to add the Mylib project as a library

2. "Add jars" add mylib inside the Libs directory Myobject.jar add in.

3. Copy the Activity service privileges added to the configuration file of the MyObject project into the configuration file of your project.

Done

A project with a res resource file needs to be made into a jar package for others to use a workaround

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.