Joke Collection Website - Public benefit messages - How to import Android SDK source code into Eclipse
How to import Android SDK source code into Eclipse
Specifically, there are two ways.
The first method: When you create the android project, select
Create project from existing source and click to select
Browse and find the desired item in your computer imported code.
Second: You can create an Applocation name
Package name
Create Activity
There are also projects with the same android version
p>
After creation, right-click and select Import and then File System
Find the project you want to import and import everything in it.
Learning the source code of android, such as Browser (browser), Mms (MMS/SMS), Phone (phone), Contacts (contacts) may have errors in eclipse. The reasons may be as follows: :
1. APIs not included in the SDK (publicly released) are used. There are two situations:
a Classes marked by @hide: These classes are hidden Most of these classes are under the com.android.internal package;
b Some Google private APIs that are not included in the SDK are mostly under the com.google.android package
b p>
2. Some aidl interfaces declared by the framework layer are used to access system services. However, these aidl interfaces are converted into .java source code during compilation, so they cannot be accessed when compiling these applications in the SDK environment.
The solution is:
(Please note: the out directory is the output directory after a complete compilation in a complete source code compilation environment (Linux))
1. Find the 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;
Add the found .jar file as User Library in Eclipse to the Project's Library dependency, and Place the order of this library 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 those that are missing , generated when compiling, .java source files, they 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 ;
Connect the found src directory to the Project as part of the source code under Eclipse in the form of Link Source.
- Related articles
- Can I pay a New Year call on the fifth day?
- I just bought a Unicom mobile card. I can't make phone calls or send text messages. How can I know my mobile phone number?
- Planning scheme of real estate promotion activities
- Advocate scientific speech
- You can apply for the college entrance examination in Guangdong in the spring.
- How to cancel the SMS notification of Ping An Bank?
- Personal summary of college students' summer practice is 200 words
- Is the provident fund paid half by yourself and half by the unit?
- How to cancel ICBC's personal balance change reminder service?
- What are the birthday greetings?