Android source code imported into Eclipse __eclipse

Source: Internet
Author: User

Specifically, there are two different ways.

First type:
When you created Android project, you were choosing
Create project from existing source by selecting
Browse in your computer to find the code to introduce.

The second type:
You can create a applocation name
Package Name
Create activity
And the Android version of the same project.
After the establishment, click the right button to select Import and choose File System
Find the project you want to introduce and bring everything in.

Learn the source code of Android, such as browser (browser), MMS (MMS/SMS), Phone (phone), Contacts (contact) in eclipse may have errors, because there may be several below:

1, the use of APIs not included in the SDK (public release), there are two situations:

A class that is @hide annotated: These classes are hidden, most of which are under the com.android.internal package;

b Some Google proprietary APIs that are not included in the SDK, most of which are under the Com.google.android package

2, some AIDL interfaces declared by the framework layer are used to access system services, however these aidl are converted to. Java source code, so they cannot be accessed when compiling these applications in the SDK environment.

The solution is:

(Please note: The Out directory is under the full source code compilation environment (Linux), perform a full compiled output directory)

1, find those hidden classes, they are in the following two locations:

A, Out\target\common\obj\java_libraries\framework_intermediates/classes.jar;

B, out\target\common\obj\java_libraries\android-common_intermediates\ Classes.jar;

The. jar file that will be found, added as a user library to Project librarys dependencies in Eclipse, and placed in the order of the library above the Android SDK library.

In the Out\target\common\obj\java_libraries\ directory, there are many other specific application-related jar packages, .... ;

2, find those missing, compile-time only generated,. Java source files, which are usually in the following locations:

A, out\target\common\obj\java_libraries\xxx _intermediates\src directory, XXX is the name of the relevant module;

B, out\target\common\obj\apps\ XXX _intermediates\src directory;

The SRC directory that will be found, under Eclipse, is connected to project as part of the source code in the manner of link source.

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.