How to compile android4.0 in eclipse

Source: Internet
Author: User

Source code: http://download.csdn.net/detail/victoryckl/4990533

Note:

If you download the source code that has been repaired, you only need to perform steps 3, 4, and 8.
Eclipse version: ADT-bundle-Windows (Android Developer Tools Build: v21.0.0-519525)

1. From the android4.0 SystemCodeCopy a copy of the browser code to the local folder and rename it as browsereclipse:
<Android4.0 source code>/package/apps/browser --> <local directory>/browsereclipse

2. Import the project browsereclipse in eclipse.
Choose file-import and choose Android-existing Android code into workspace.
Browse the folder and select the project root directory: <local directory>/browsereclipse.
Remove the check button for the tests project.
Rename a project: Right-click a project, choose refactor-Rename, and enter browsereclipse.
At this time, there will be many errors in the project, so ignore them for the moment.

3. Add a library file.

Copy the corresponding file from the out directory of the compiled android4.0 source code to the systemlib path of browsereclipse. The file is as follows:
Browsereclipse \ systemlib \ out \ target \ common \ OBJ \ java_libraries \ android-common_intermediates \ Classes. Jar
Browsereclipse \ systemlib \ out \ target \ common \ OBJ \ java_libraries \ android-support-v13_intermediates \ Classes. Jar
Browsereclipse \ systemlib \ out \ target \ common \ OBJ \ java_libraries \ android-support-v4_intermediates \ Classes. Jar
Browsereclipse \ systemlib \ out \ target \ common \ OBJ \ java_libraries \ core_intermediates \ Classes. Jar

Browsereclipse \ systemlib \ out \ target \ common \ OBJ \ java_libraries \ framework_intermediates \ Classes. Jar

Refresh the project in eclispe, select a project, and right-click the project menu-build path-configure build path,
On the Libraries page, select Add library-user libraries-New, enter the library name systemlib, and check "system library" in the input box ".

Return to the user libraries window, select the newly created systemlib, and click "add jars" to add the five classes. Jar files under the systemlib \ folder.

All the way to the OK button, return to the Java build path interface, select the order and export page, select create systemlib, click the top button, top to first, OK.

4. Set Java compiler to 1.6.
Then select the project, right-click the menu-properties-Java compiler, and select 1.6

5. Shield some code.
After step 1, return to the eclipse editing interface and refresh the project. At this time, most of the errors have been solved. There are only a few errors left, so you can block these errors:
Shielding eventlogtags-related rows:
Browsereclipse \ SRC \ com \ Android \ browser \ logtag. Java;
Shield rows related to visiblefortesting:
Browsereclipse \ SRC \ com \ Android \ browser \ browseractivity. Java
Browsereclipse \ SRC \ com \ Android \ browser \ provider \ browserprovider2.java
Browsereclipse \ SRC \ com \ Android \ browser \ AutoComplete \ suggestedtextcontroller. Java
At this time, there should be no compilation errors.

6. Add a Java file to avoid running errors:
Browsereclipse \ SRC \ com \ Android \ common \ content \ syncstatecontentproviderhelper. Java
Source code from android4.0:
Frameworks \ ex \ common \ Java \ com \ Android \ common \ content \ syncstatecontentproviderhelper. Java

7. Modify browsereclipse \ androidmanifest. xml and add <uses-SDK Android: minsdkversion = "14"/>
Modify the target attribute value in browsereclipse \ project. properties to target = Android-14.

8.uninstall the system application broser.apk and install browsereclipse.apk.
Here, you need to root the machine before proceeding. This APK can only run normally in the android4.0 system and cannot run in 4.1.
Back up/system/APP/browser.apk and browser. odex, and copy it to/sdcard.
Delete/system/APP/browser.apk and browser. odex and restart the machine.
Install browsereclipse.apk to view the effect.

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.