apk, war, Ear Zip compression available, It looks like these four packages are zip/jar in a simple way to Generate.
------------------------------------------------------------------------
android-apk Packaging Process &adb common directives (
go to: http://15035554141.iteye.com/blog/2090198)
Android-apk.png
Procedures for Package & installation
Src: Jar file compiled as class file
Gen Under: auto-generated Files
Android-dx.png
Call Dx.bat to convert class file to Dex file
Generate signature
- 。 Convert Java files to. classes bytecode
- Convert. Classes files to Dex files using Dx.bat
- Package all the resources into a RESOURCES.AP_ file.
- Pack all the resources, dex, inventory files into apk files (apk nature is zip compressed File)
- The next step is Meta-inf's signature File. (APK generates Digital Signature)
- Next Abd debug the bridge and install the APK onto the virtual Machine.
If there is a problem with the program, you can view the project according to the process where error
How is the APK installed on your Android phone?
For example, window installation files, specifying the installation directory, the process is to copy the installation package files to the specified installation directory
Window unloads the files and deletes the files copied from the installation directory.
Android under Install App:
- Copy xx.apk to/data/app/xx-1.apk
- Create a folder under The/data/data directory with the folder name as the package name for the current application
- Uninstall/data/data file delete, delete/data/app/apk file
Android registry: stored as XML file, read files faster
/DATA/SYSTEM/PACKAGES.LIST-APK the corresponding Data directory
/packages.xml-package name corresponding location, digital signature and other information
--------------------------------------------------------------------------------
java-based Packaging of jar, war, ear package and the difference between the detailed
turn from: http://blog.csdn.net/liu36032075/article/details/10615275
|
Jar |
WAR |
EAR |
English |
Java Archive File |
Web Archive File |
Enterprise Archive File |
Include content |
class, Properties file, is the smallest unit of file encapsulation, including Java class common library, resources, auxiliary files (auxiliary files), etc. |
servlets, JSP pages, jsp tag libraries, jar Library files, html/xml documents, and other common resource files, slices, audio files, etc. |
In addition to including jars and wars, EJB components are included |
Deployment files |
Application-client.xml |
Xml |
Application.xml |
Container |
Application Server (application Servers) |
Small Service Program Container (servlet Containers) |
EJB Container (EJB Containers) |
Level |
Small |
In |
Big |
1) Packaging of ear files
The ear file includes the entire project and contains multiple EJB module (jar files) and Web Module (war files).
The generation of the ear file can be generated using WinRAR as a zip compression or as a jar command from the command line.
Steps:
1>, first package into war and jar, and write good application.xml, put in Meta-inf directory.
2>, run the jar CF your_application.ear Your_war.war your_jar.jar meta-inf\application.xml (assuming All in the current directory).
of course, You can also use the Jar XF your_application.ear to Decompress.
Application.xml is used to describe the war and jar included in your ear.
Examples of the application.xml of WebLogic Petstore:
View Plain
- <! DOCTYPE application Public '-//sun microsystems, inc.//dtd java EE application 1.2//en ' http://java.sun.com/j2ee/dtds/ Application_1_2.dtd '>
- <application>
- <display-name>estore</display-name>
- <description>application description</description>
- <module>
- <EJB>customerejb.jar</ejb>
- </Module>
- <module>
- <EJB>mailerejb.jar</ejb>
- </Module>
- <module>
- <Web>
- <web-uri>petstore.war</web-uri>
- <context-root>estore</context-root>
- </Web>
- </Module>
- <module>
- <EJB>petstoreejb.jar</ejb>
- </Module>
- <module>
- <EJB>signonejb.jar</ejb>
- </Module>
- <module>
- <EJB>personalizationejb.jar</ejb>
- </Module>
- <module>
- <EJB>inventoryejb.jar</ejb>
- </Module>
- <module>
- <EJB>shoppingcartejb.jar</ejb>
- </Module>
- <security-role>
- <description>the Gold customer role</description>
- <role-name>gold_customer</role-name>
- </security-role>
- <security-role>
- <description>the customer role</description>
- <role-name>customer</role-name>
- </security-role>
- <security-role>
- <role-name>administrator</role-name>
- </security-role>
- </Application>
(2) use of war
1>, generate the war file using the following command: JAR-CVF Web1.war *
2>, See what files are in web1.war, you can use the Command: jar-tf Web1.war
3>, Unzip the Web1.war file, you can use the Command: jar-xvf Web1.war
In addition, you can use the WinRAR software to select the Zip compression method, and the compressed file suffix to the war can be compressed to generate a war file, also use the WinRAR software can forcibly open the war file, or forcibly extract the war file
The difference between using the jar command and the WinRAR software is that the Meta-inf folder, which contains the MANIFEST.MF file, is generated while the file is Compressed.
(3) when to use war or jar files
When your project is not fully completed, it is not appropriate to use the war file, because your class will often change because of debugging, such as to delete, Create a war file is very uncomfortable, preferably your project has been completed, do not change, then make a war package it, At this point a war file is equivalent to a web application, and a jar file encapsulates a class and some related resources into a package for easy reference in the Program.
the role, difference, and packaging of Java's packaged jar, war, ear package:
1. Function and Difference
I. Jar: usually the development time to refer to the generic (JAVA) class, into a package for easy storage management;
Ii. War: is to do a (web) application, usually a Web site, into a package deployed into the container;
Iii. ear: Enterprise applications, in fact, the ear package contains a war package and several Enterprise-level project configuration files, The general server select websphere, etc., will use the ear package. typically, an EJB is called into an ear packet.
2. Packing method
I. All packages are hit with jars, except that the target file has a different extension;
Ii. You can also use ant to build ancheng.
3, jet compiled into EXE
I. Jet is money to buy, and it is said that jet is not able to compile all the Java programs to execute files, performance also have to Discount. so, the best way to make the executable JAR file package is to keep the Java cross-platform feature.
Attention:
After the Web project is exported as a war, it is placed directly under the WebApps of the Tomcat container and the service is started, and the war package automatically extracts a folder with the same name.
[go] java Packaging apk, jar, war, Ear Package