Android Studio Learning----importing jar packages via Libs

Source: Internet
Author: User

Baidu experience There is a way:

  1. 1

    Click Start Androidstudio, after the start of the interface.

  2. 2

    Copy the jar you need to add and paste it into the App--src--main--libs folder, The Androidstudio projects that can be run have a directory structure like this.

    Can see that although the jar has been copied and pasted, it has not yet been imported, so the contents contained in the jar are not visible. Import jar, you can see the contents of the jar.

  3. 3

    Right-click on the new sticky jar and click on the add as Library in the pop-up menu.

  4. 4

    Select the module you want to import into (equivalent to project in Eclipse in Androidstudio), if it's just a project, The dropdown box has no other content than the app, so click OK to confirm.

  5. 5

    The jar is added to the project.

         when it's done, it's automatically generated in the build.gradle below  module:
     compile files (' libs/ Webwork-2.2.4.jar ') 

    Method Two: is to copy the jar package into the Libs folder, directly to the corresponding module under the Build.gradle and add the above code is also possible,

    Method Three: Add in project structure, there is a File dependencecy


Android Studio learning----to import jar packages via Libs

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.