Build the debugging environment of Android source code Luncher2

Source: Internet
Author: User

1. Preparations
1. Copy the entire packages/apps/Launcher2 folder in the source code to a directory, which cannot be an Eclipse project directory such as wrokgroups. It is best to create a folder in the root directory of drive d without Chinese characters (habit)
2. Create an Android project, select "Create project from existing source", and specify the path of the project, that is, the folder created in step 1. SDK you need to select (2.3.3) based on the Android version supported by the Project you downloaded, and then "finish ".
3. Delete the project, and copy the folder created in 2 to the Eclipse working directory.
4. File/Import/General (Existing Projects into Workspaces)/Browse select the project copied in step 3. Then Launcher is imported into Eclipse. However, there will be a lot of red forks in the project, and we will solve this problem later.
2. Import the packages required by the project
First, you need to compile the android code. After compilation, some package files will be generated, and the following three files will be copied to the root directory of the D Drive (you can choose any one)
Here we use: (the generated package path is out/target/common/obj/JAVA_LIBRARIES of the source code)
1) framework_intermediates/classes. jar: This is mainly the framework class of android.
2) android-common_intermediates/classes. jar: This contains the com. android. common. Search Class
3) core_intermediates/classes. jar: This package contains the dalvik. system. VMRuntime class.
These are all packages that need to be imported into the project. You can add these packages by configuring the Build Path of the project,
Right-click the project name and select Build Path> Configure Build Path... -> Libraries-> Add Library-> User Libraries... -> New... enter any name (note that System Library must be checked first), and then select Add JARs to select three classes. jar. Repeat three times to import all three classes. jar files.
After adding the three packages, you also need to put them in front of the android2.3.3 package. You can select Order and Export IN Build Path configuration (Note: select three new directories, then UP is enough)
At this time, you will find that the Launcher2 project and there is no error, you can also compile it.
Third, you need to rename the project
Project package name, because the package name in the simulator conflicts with the program name. Www.2cto.com
1. In eclipse. Right-click src/com. android. launcher and choose "Refactor"> "Rename...". The name can be customized. Select all options)
2. Click "Preview>" to Preview it (if a warning is displayed on the way, skip this step and continue "Countinue"). Remove unnecessary modifications here, otherwise it will be messy.
3. Modify the custom VIEW package name in XML
Note: android: sharedUserId = "@ string/sharedUserId" in AndroidManiFest. xml is deleted; otherwise, startup will fail.
 
4. The configuration file for modifying eclipse is eclipse. ini (My Eclipse3.6.2)
Eclipse. ini is as follows:

01-startup
02 plugins/org. eclipse. equinox. launcher_1.1.1.R36x_v20101122_1400.jar
03 -- launcher. library
04 plugins/org. eclipse. equinox. launcher. gtk. linux. x86_1.1.2.R36x_v20101019_1345
05-product
06 org. eclipse. epp. package. jee. product
07 -- launcher. defaultAction
08 openFile
09-showsplash
10 org. eclipse. platform
11 -- launcher. XXMaxPermSize
12 512 m
13 -- launcher. defaultAction
14 openFile
15-vmargs
16-Dosgi. requiredJavaVersion = 1.5
17-XX: MaxPermSize = 512 m
18-Xms512m
19-Xmx1024m

Author: android. google

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.