Export the android project as a jar package.

Source: Internet
Author: User
[Abstract] How does android ProgramCompress it into a jar package and export it
1. Create a Java Project
2. Add Android. jar to Java build path> libraries.
3. In package explorer, right-click the project and choose export Java-> JAR file.

Use
1. Create an android Project
2. Add the JAR file to the project property Java build path> libraries.
3. Use the jar class in the android project.

Shared only in jarCodeAnd cannot use resources.

--------------------------------------------------------------------------------

What if I encapsulate my code into a jar library for reuse by other programs?
First, create an android project and confirm that the project can be compiled,
Remove the androidmanifest. xml file and related program resource images.
In eclipse, find package explorer and select export,
In the export dialog box, select Java, JAR file,
In JAR File Specification, select the resources we need everywhere, and so on,
In JAR file: select the path where the exported files are stored,
Select compress the contents of the JAR file to compress the size of the generated file.
Click Next or finish to complete the export,
In this way, you can import this library into future projects, and the effect of code reuse is similar to that of DLL files developed by Windows 32.

Related Article

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.