Import the built-in launcher2 source code to eclipse for compilation and running.

Source: Internet
Author: User

Http://blog.csdn.net/wzcqr0501/article/details/6931453

 

 

Note: Right-click the project and choose build path> Add library> User libraries> New> Any Name> Add jars> OK.

Systemlibrary selected

 

 

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.
The following error occurs: unable to execute DEX: Java heap space. Eclipse is basically stuck.
Solution: import the project JAR file by adding user library.
Right-click Project-> build path-> Add library-> User libraries-> New-> just get a name-> Add jars-> OK
Remember to select user systemlibrary during adding
3. Modify launcher2PackageName, because the package is the same com. Android. launcher but the digital signature is different, the system will refuse to install

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!

After the package is changed, the compilation error occurs. The problem occurs in several places in res where xmlns: launcher = "http://schemas.android.com/apk/res/com.android.launcher", and the last "com. android. change launcher to be consistent with the changed package name.

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

Finally,Installation Error: install_failed_conflicting_provider occurs when the simulator is installed:

In androidmanifest. XML
Android: change the value of authorities to another one.

 

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.