Android-eclipse shared library and exported jar packages, androideclipse

Source: Internet
Author: User

Android-eclipse shared library and exported jar package [conversion], androideclipse

 

Directory (?) [-]

 

When android apk is developed on eclipse, you sometimes need to import some classes in other packages. The normal method is to add the jar package to the library in java build path!

Reprinted with the source: http://blog.csdn.net/jscese/article/details/36627195

 

Shared Class between one. APK

To use the class of another project in an androoid project in eclipse, you canProject. propertiesFile:

 

 

[Html]View plaincopyprint?
  1. Android. library. reference.1 = project path

Reference.1 indicates the serial number of the library. If there are multiple numbers, add them in sequence,

 

 

Project path indicates the path of the target project, which can be an absolute or relative path.

 

Configure the target project as follows:

Properties --> Android --> Is Library click!

 

In this way, the referenced class will be searched during compilation, and the referenced library name can be seen in the compiled project Properties --> Android!

 

 

Ii. APK export jar package

In many cases, you cannot directly send source code projects. In this case, you can select the export that comes with eclipse.

 

Select JAR file. Next step:

 

 

Select the export path. You can select whether to import some deployment and compilation files in the upper right corner. finish.

Jar package after completion:

 

We can see that the src resource file and res resources are also packaged into the jar package,

This jar package can be used by other projects by adding external jar in the java build path option!

 

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

After selecting the Is Library option, compile the entire project and generate the corresponding project. jar in the bin directory.

 

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.