Android Studio Tutorial (illustrated) for importing libraries in various situations

Source: Internet
Author: User

Android Studio is Google's push development tool, and the introduction of the library is a big difference from the traditional eclipse.

One, jar package

The first step, the Libs in the project directory, is to copy the jar inside. Such as:

The second step, switch to the Android directory, open Build.gradle (Module:app). Such as:


Then, the program needs to be compiled into code that needs to be added manually or GUI settings .

Add Manually:

Generally there is a piece of things, add a sentence to let the program compile your just copy of the jar.

If I'm gson-1.6.jar, it's a complete code snippet.


Graphical interface settings are added automatically:

Shortcut key ctrl+alt+shift+s or menu File->project structure

After you see this interface, select the left side of the Modules->app, then click on the tab on the right dependencies, then click on the right side plus, click File


Easily Select Libs Add



Second, the Library project package

The first step is to copy the third-party project package to the project.


The second step, the third party project to add to their own projects, Settings.gradle, plus ': Canvasdemo ', this is I add the project include, and then sync a bit gradle.


The third step, similar to the above add jar package, two ways, I will briefly say, two ways.

To add a build manually:

Switch to Android directory, open Build.gradle (Module:app), and add a sentence

Such as:


To add a compilation automatically:

Shortcut key ctrl+alt+sshift+s or menu File->project structure

After you see this interface, select the left side of the Modules->app, then click on the tab on the right dependencies, then click the plus sign on the right, click the module


And then you know,



The Guide Package illustration tutorial is complete. The next article or guide package, will be specific to the case guide package for text and graphics.


Android Studio Tutorial (illustrated) for importing libraries in various situations

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.