Joke Collection Website - Blessing messages - How to import sdk source code through eclipse

How to import sdk source code through eclipse

Specifically, there are two ways.

The first one: When you create an android project, you choose.

After creating a project from an existing source, press Select.

Browse to find the code to import on your computer.

Second, you can create an application name.

Package name

Create activity

There is also the same Android version of the project.

After creation, right-click and select Import, and then select File System.

Find the project you want to introduce and just introduce everything in it.

Learning the source code of android, such as Browser, multimedia message (MMS/SMS), Phone and Contacts, may make mistakes in eclipse for the following reasons:

1, using an API that is not included in the SDK (public release), there are two situations:

A classes marked with @hide: These classes are hidden, and most of them are under the com.android.internal package;

B. Some private Google APIs that are not included in the SDK are mostly under the com.google.android package.

2. Some aidl interfaces declared by the framework layer are used to access system services, but these aidl interfaces will only be converted into. Java source code, so you can't access these applications when compiling them in SDK environment.

The solution is:

(Please note: the out directory is the output directory after complete compilation in the complete source code compilation environment (under Linux)). )

1, find hidden classes 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;

Add found. The jar file is the dependence of the user library on the project library in Eclipse, and the order of the libraries is placed above the Android SDK library.

In the out \ target \ common \ obj \ Java _ libraries \ directory, there are many other jar packages related to specific applications.

2. Find the missing person. Java source files generated at compile time. They are usually located in the following locations:

A, out \ target \ common \ obj \ Java _ libraries \ XXX _ mediators \ src directory, XXX is the name of the related module;

Connect the found src directory to Project as a part of the source code in the form of linked source code under Eclipse.