In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will talk to you about how to use eclipse to download code edited by Android Studio from Github. Many people may not know much about it. In order to let everyone know more, Xiaobian summarizes the following contents for everyone. I hope everyone can gain something according to this article.
Since Github is currently a popular code hosting site, many excellent source codes can be downloaded from the Git platform for reference. But for android developers, many of the source code downloaded from git has been edited by Android Studio, which is Google's "biological"IDE. After all, it is a new product, there are many unavoidable bugs, plus many Android developers are heavy users of Eclipse, so the following mainly describes how to download code edited by Android Studio from Github with eclipse.
Download Github code from Eclipse
Open Eclipse, click "File" and then click "Import";
2. In the pop-up window, select Git--->Projects from Git, select URL, then pop up to enter the download source address, paste the target source address, select everything default, if you have downloaded Git client (account password login successful), the following "User" and "Password" can not be filled in, directly click "Next":
3. Next pop-up window, select the downloaded content branch, if there is a "master" option, just check this item, continue to click Next;
4. Next, select the save path, other defaults, click Next to download (it is not recommended to download the file in the workspace folder);
5. At this time, the download has been completed, the next window is the import of the download project, there is no need to rush to guide, close the window:
Import the project into Eclipse
The process of downloading the source code from Git has been described above, and the next introduction is to import the project, which is also the focus of this article. Although Android Studio is a tailor-made IDE for Android developers, it is now a waste of Goole's painstaking efforts to change the source code to run on Eclipse, but the reasons have already been introduced above, and there is no more burden here. Okay, let's start importing.
1. Let's open the project we just downloaded, click Library-->src-->main, and the following image appears:
2. As you can see, we need to convert three important files have appeared, respectively java (this different project name will be different), res and familiar AndroidManifest.xml file, of course, different project files show different, but there will be these three key files, which need everyone to look for it ~ find these files after what? Okay, let's start by opening the xml file:
You can see that its Packname is "com.telly.floatingaction";
3.Eclipse Create a new "Android Application Project", fill in "com.telly.floatingaction" to the corresponding Packname, fill in floatingaction for Application name, click Next;
4. Keep clicking "Next" until the option of whether to create an Activity by default appears, uncheck and click "Finish";
5. Well, a new project has been built. Why create an empty project? Because the code structure of the project edited in Android Studio is different from that of the android project in Eclipse, importing the code directly into Eclipse will not work successfully. In short, creating an empty project ensures that the empty project structure is the same as the android code structure that normally runs in Eclipse. The next step is to download the source directory one by one corresponding to the blank project copy.
As mentioned above, we need to focus on three files, java, res and AndroidManifest.xml. What should we replace next? Let's start with a successful android project running in Eclipse:
You can clearly see that there is a src, res, and AndroidManifest.xml file in this project. By the way, I believe everyone knows that the next step is to directly replace the three files we just found with the corresponding files of the blank project. java-->src, res-->res, AndroidManifest.xml--> AndroidManifest.xml (it is recommended to copy and paste directly in the workspace folder, which is not easy to make errors).
6. After successful replacement, right-click on the project name, select "Refresh," and you are done.
PS: Some projects will report an error with a low API version after successful replacement. We only need to right-click Properties-->Android in the project and select the required API on the right. If it is not provided, you need to download the update from Window-->Android SDK Manager;
After reading the above, do you know how to download code edited by Android Studio from Github using eclipse? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.