How to use an open source project in Eclipse in Android studio

Source: Internet
Author: User

In recent days, I have used some open source projects, such as the famous PTR project. But in the process of use, encountered some problems.

This open source library is written on eclipse, and we are now developing Android Stuido.

The project structure of the two kinds of software is different, so how to use PTR in our project?

Through the search of network materials, and finally found a set of solutions to solve these problems, below, we will start from 0 to step into the PTR this library into our Android studio

First, get this library from GitHub.

Locate the local library, open Android Studio, select Import Project (Eclipse ADT), and locate our library file.

Next we'll click on the next step, and Android Studio will convert the project structure of our choice.

Next, we create a new project, named Pulltorefreshtest.

We find the project directory, create a new Exlib (arbitrary) folder below, copy the project we just converted into here

Next we open the new Pulltorefreshtest project and make some settings for the Gradle file

First switch to Project view and add ': Exlib:ptrlib:app ' to the Setting.gradle file.

Next go to the app directory, locate the Build.gradle file, open it, and add some information to the dependencies.

At this point we are the import success, but it is possible that our Lib project compiled version of our machine does not, this time we can find the project Gradle file in Exlib, to modify

At this point, a basic Eclipse project was successfully imported into our Android Studio project.

Below is

How to use an open source project in Eclipse in Android studio

Related Article

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.