How Android Studio imports the Slidingmenu class library

Source: Internet
Author: User

Transferred from: http://www.codes51.com/article/detail_183523.html

Now see how Android Studio use third-party library ~ Online to find a lot of tutorials seems to have a problem, I tried it, simple, pro-test effective

First step: Prepare the library file in Android Studio format

Import Slidingmenu in Android Studio (detailed)

As in the introduction of GitHub Open Source Project Slidingmenu Summary, I started as import Slidingmenu when also Baidu a lot of articles, write is not very detailed, so import success, wrote this article, I want to be inspired by the small partners who want to use Androidstudio to import slidingmenu.

First on the final animation

First step: Download Slidingmenu (Https://github.com/jfeinstein10/SlidingMenu)

Step two: In the project, click Import Module, File--New

1. Select Library

2, if already contains this module, will appear after the exclamation point hint, the first time certainly did not have

If the import is successful, you can see the imported modules in the library


Step three: Modify the Build.gradle file of the library file

Build.gradle file to match

1. The Build.gradle file under the imported module

2. build.gradle file under App module

Build.gradle files under the app module

Here is the Build.gradle in the modified library file.

Fourth Step: Locate the project's Build.gradle file under Project view, replacing the classpath of the library file

Fifth step: This is not a universal step (can be ignored)

Slidingmenu is used in the Android.util.FloatMath class, the import will be error, because this class is obsolete, it is recommended to use the Java.lang.Math class ~ only need to find the corresponding error, the Floatmath replaced with the math class can be

Sixth step: Set up Project Dependencies

In the form of Add module dependency, associate the library file; then clean it up project~

Slidingmenu is waiting for you to toss.

In this case, the process of importing third-party libraries into Android studio should be similar.

How Android Studio imports the Slidingmenu class library

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.