Import simple Android Studio simple project in Eclipse

Source: Internet
Author: User

Objective:

Now the Android studio version has gone to 2.0 (I'm using the developer version for the time being), but it's still the same as the previous version.

(because I used a lot of third-party UI controls, which led to a very long project in the Android studio build, it takes about two or three minutes to change about one character and a maximum of 5 minutes.)

In eclipse, however, it takes up to half a minute to build to the phone, greatly reducing the time to compile the project and helping to develop debugging. )

So I still use Android studio to develop, Eclipse to compile the project.

But today is not the way to say how the Android studio is compatible with Eclipse projects.

It's a simple project in how Eclipse is compatible with Android Studio (I'll just be simpler.) )

0.: You have to have a simple project for Android Studio and it's best to run it yourself.

(And if you are a rookie, even Android studio and Eclipse Android project structure do not know, I advise you do not look at this article, will become silly, haha ha)

1.: You create an Android project in Eclipse. (It's best to run it again), then copy one as a backup and

SRC, libs, res, androidmanifest.xml and assets (this deletion is not a problem, but if you have it in Android Studio, you have to delete it to avoid any problems)

These files or folders are deleted. Hope to get one of the following

  

2. Then copy the SRC and Libs folders in Android Studio's startup Project app (typically the name), which is typically created in Android studio, and stick directly at the root of the Eclipse project.

At this point basically has copied the Android Studio project Basic source to eclipse.

  

3. You need to configure eclipse at this point. Allow it to compile its files.

A. Right-click the Src/main/java folder, indicating its "Android project" src

       

Or

Add <classpathentry kind= "src" path= "Src/main/java" in ". Classpath" under its project/> This line of code is configured

B. Then the Res folder is configured, and the profile that needs to be opened is the ". Project" of the root directory in the project.

And the final result is this.

The code is as follows

<linkedResources>
<link>
<name>res</name>
<type>2</type>
<locationURI>PROJECT_LOC/src/main/res</locationURI>
</link>
</linkedResources>

This completes the configuration of the Res.

Explain

The "linkedresources" node describes the introduction of the contents of "Resources" into "Selected directories"

"Name" is an alias under the root directory

"Type" value "2" stands for "folder" meaning, "1" means "file"

The path that "Locationuri" was introduced. (Note that this path is an absolute path,

So it's necessary to explain what "Project_loc" is,

"Project_loc" is the absolute path to the current root directory. is a constant of Eclipse's project.

In

})

C.

I. Finally, copy the file "Androidmanifest.xml" to the root directory of the Eclipse project.

Or

II in the ". Project" Add

<linkedResources>
<link>
<name>AndroidManifest.xml</name>
<type>1</type>
<locationURI>PROJECT_LOC/src/main/AndroidManifest.xml</locationURI>
</link>
</linkedResources>

It has been explained once, so it is not explained in detail here.

can be done.

D. Of course, if Build.gradle's dependencies (dependency package) is written to introduce a "third party jar" or "third-party AAR", it can only be downloaded by itself.

(This article does not discuss this first.) If you want to know, please visit here:http://www.cnblogs.com/shortboy/p/4424944.html)

Finally, you can try to compile the Eclipse project.

There are two points to note:

1. Is the use of linkedresources, if the linked file or folder does not exist, or appear unknown error, so you need to pay attention to the use of

2. When you copy a project containing linkedresources you must go to ". Project" To change the root path of the project, otherwise the referenced file will be messy.

Import simple Android Studio simple project in Eclipse

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.