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