A few days ago, I downloaded an open source project from GitHub and found that he was not the directory structure of the previous eclipse.
It is the file directory of the most recently used Android studio. From which we can see that the word gradle has appeared many times. The combination of Android Studio + Gradle is very handy, and many third-party open source projects have migrated to Studio early, so let's take a look at this combination.
1. What is Gradle
Gradle is based on the groovy language and is oriented toward Java applications. Automated building tools based on DSL (domain-specific language) syntax. This is the interpretation of the Baidu Encyclopedia, from a personal understanding, we can see it as a building of our project or project a tool. So do not assume that it can only be used in conjunction with our Android studio, which is gradle for the previous development tool eclipse. It's just that Android studio's default build-engineering tool is gradle.
2. Import Android Studio
In the face of such an open source code downloaded from the Internet, how can we import it into our development tools? If you want to import into eclipse, we need to download and install the Gradle and groovy plugins ourselves. Here we still use Android Studio as our development tool
2.1 First we open our Android studio
If you have a project before, you can close the project. Here we choose Import non-android Studio project.
Choose the Open source code that we should download relatively well. Click OK
Error message
This error appears to prompt us not to download gradle, this time we click on the Gradle option in the right sidebar of Android studio
Appears as shown in the pop-up window
Click on the plus sign to pop up a Select Directory window and select the Build.gradle in the project directory we want to import.
Appears as shown in the window, click OK.
Pop up as shown in the window
Download the gradle We need, this needs FQ. The download speed is relatively slow.
After this download is complete, our project will be imported. About Gradle is also a beginner, some of the content is still in the study, but also hope to communicate with you.
Android Studio Import Open Source project