1. The introduction of the jar
JAR (Java ARchive) Is a platform-independent file format that combines multiple files into a single file. Users can bind multiple Java applets and their required components (.class files, images, and sound) to JAR files and download them to a browser as a single simple HTTP transaction. This greatly improves download speed. The JAR format also supports compression, which reduces file size and further reduces download time. Alternatively, the applet writer can digitally sign items in the JAR file to confirm their origin. Written in Java, it is fully backward compatible with existing applet code and fully extensible.
2. Generation step
The Java development process requires the generation of jars, and the JAR package needs to be set up in several steps
Create a new module in Android Studio, then configure it as follows, and finally compile it with makejar to generate the JAR package.
2.2 Add the generate JAR configuration to the build.gradle file
ndk {**** **** ****moduleName **”testlib” // abiFilters “armeabi”, “armeabi-v7a”, “X86” // output the three specified ABI so libraries ** *****}* **** sourcesets. main **{**** jni.srcdirs = [] jnilibs.srcdir **”src/main/libs”** **** ******}
2.3 Generating a JAR Package
// Generate the jar package **
* Task makeJar(type: Copy) {* * * * * * * * / delete/remove the old jar package * * * ‘build/libs/ndtqlib jar’ * * * * / / the original address (this address will change due to different versions *) from * * ( ‘build/intermediates/aar_main_jar/release/’) **into(‘build/libs/’) // include(‘classes.jar’) Mysdk *rename (‘classes.jar’, ‘testlib.jar’) **} ** makejar.dependson (build)