"Go" android--eclipse Share Library and export jar package

Source: Internet
Author: User

Original URL: http://blog.csdn.net/jscese/article/details/36627195

Android APK in the development of eclipse, sometimes need to import some classes in other packages, the normal way is to add the jar package in the Java Build path library!

Reprint Annotated Source: http://blog.csdn.net/jscese/article/details/36627195

A. apk to share class between

One of the androoid projects in eclipse to use the class of another project, you can add it to the project's project.properties file:

[HTML]View Plaincopyprint?
    1. android.library.reference.1= Project Path


REFERENCE.1 indicates the number of the library, and there are a number of words added in turn,

Project path represents the path to the target project, either an absolute path or a relative path

The target project needs to be configured as follows:

Properties-->android-->is Library Point selection!

This will be compiled to find the reference class, but also in the compiled project Properties-->android to see the reference library name!

Two. APK Export jar Package

Many times you cannot directly originate the code project, this time you can choose the export from eclipse

Select the JAR file next:

Choose the path to export, some of the deployment and compilation files in the upper right corner can be imported or not, finish can

After the completion of the jar package:

You can see that the SRC resource files and res resources are also packaged into the jar package,

This jar can be used by other projects by adding the add external jar in the Java Build path option!

There is also a way to package the project into a jar package:

As mentioned above select is Library this option, then compile the entire project, will be in the bin directory to generate the corresponding project. jar

"Go" android--eclipse Share Library and export jar package

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.