Transfer from http://blog.csdn.net/lincyang/article/details/44457799
As does not have an independent module project, but you can add a module to normal project. The so-called module is a modular unit that we usually refer to, and is often present in the form of a jar package. The following is a demonstration of the modularity of the as in an example of getting cell phone information.
First, the new module in the project
File->new Module, see details.
Second, import the code into the module
Copy the code you need to package into the Main->java folder of the corresponding module
Of course, the corresponding resource files should be copied into the corresponding folder.
Third, the introduction of this module in the app
Add the dependency of this module to the app's Build.gradle, as follows:
dependencies { compile ' com.android.support:appcompat-v7:21.0.3 ' Compile project (': MyLibrary ')}
Iv. Generation of Jars
After the project is compiled, the jar is found in the following directory
./zxing/build/intermediates/bundles/debug/classes.jar./zxing/build/intermediates/bundles/release/classes.jar
V. Removal of module
In the File->project structure, the module "minus" is removed before the right-click Delete key in the project is available.
Reference:
Http://www.cnblogs.com/wuya/p/android-studio-gradle-export-jar-assets.html
Http://www.cnblogs.com/helloandroid/articles/2210334.html
http://blog.csdn.net/hyr83960944/article/details/37519299
Android Studio tips: Exporting Jar Packages