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?
- 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.