Android Studio tips: Exporting Jar Packages

Source: Internet
Author: User
Tags delete key

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

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.