Import Android launcher2 to eclipse and run it.

Source: Internet
Author: User

1. Import the launcher2 project to eclipse.
At this time, the launcher2 project has been imported into eclipse, but there will be more than 100 errors.


2. Add the package file used by launcher2.

In the android source code, many methods, members, classes, and packages are tagged with @ hide, which are not disclosed in the SDK, android is the most common class used to compile the launcher source code. view. view member mscrollx cannot be accessed. Therefore, you must first download the android code and compile it properly, because you need to use some compiled class. Jar files.

Here we use: (the generated package path is out/target/common/obj/java_libraries)
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 choose build path> Configure build path...> libraries> Add library> User libraries...> New...
Add the three dependent packages one by one and name them android_framework, android_common, and android_core respectively.
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.
At this time, you will find that the launcher2 project and there is no error, you can also compile it.
3. Modify the launcher2 package name and run the changed launcher2.

Change the name of the original package. Remember to use the eclipse rename mechanism (Press F2 on the package name to modify), which is not only a reference to the class, there are also many references in XML files (such as import COM. android. launcher3.r;), all of which can be done at one time as long as the rename is good.

New name: enter your own package name,Select all the following four items. Click "preview"

Note: It is best not to place your project in the Chinese path. Otherwise, an error will occur during rename. I started to put the error in the Chinese path for a long time before I found the error!

4. Delete this sentence in the androidmanifest. xml file. (Android: shareduserid = "android. uid. Shared ")

In this case, I used launcher 2.3 to perform the experiment. The result was okay and the operation was successful!

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.