First of all, I installed 64-bit Ubuntu10.04 through wubi in Win7 (refer to the http://www.linuxidc.com/linux/2011-06/37298.htm), wubi installation can only allocate up to 30 GB space, if you need to compile Android is not enough space, you can refer to this to allocate more space. Note that at the beginning, you can only allocate the default minimum space for Ubuntu to use wubi installation, and then allocate more space based on the above
First of all, I installed 64-bit Ubuntu 10.04 through wubi in Win7 (refer to the http://www.linuxidc.com/linux/2011-06/37298.htm), wubi installation can only allocate up to 30 GB space, if you need to compile Android is not enough space, you can refer to this to allocate more space. Note that at the beginning, you can only allocate the default minimum space for the wubi installation to Ubuntu, and then modify it according to the above method, in the last step, specify the -- max-override parameter. For details, see -- help.
2. Refer to the official documentation to download and compile the Android source code. Click here. I chose Android4.0.1. During the entire process, the following points should be noted: 1. Select Make version 3.81; 2. Select gcc version 4.3. The default value may be gcc4.4, you can follow the steps below to reduce to 4.3:
- $ Sudo apt-get install gcc-4.3 g ++-4.3
- $ Cd/usr/bin
- $ Sudo ln-snf gcc-4.3 gcc
- $ Sudo ln-snf g ++-4.3g ++
- $ Sudo ln-snf cpp-4.3 cpp
- $ Sudo apt-get install g ++-multilib g ++-4.3-multilib
3, swap space is too small, resulting in compilation will produce some problems, you can refer to: http://www.linuxidc.com/Linux/2012-08/67985.htm.
4, The Source installed JDK on the official documentation may be invalid, had to go to the Oracle official website to download and install JDK1.6, such as downloading the jdk-6u27-linux-x64.bin IN ~ /Download,
- $ Sudo chmod a + x jdk-6u27-linux-x64.bin
- $./Jdk-6u27-linux-x64.bin
In this way, the installation is in the current directory, and environment variables must be configured to modify ~ /. Bashrc file, which is added at the end:
- Export JAVA_HOME = Your path/jdk1.6.0 _ 27
- Export JRE_HOME = $ JAVA_HOME/jre
- Export CLASSPATH = $ JAVA_HOME/lib: $ JRE_HOME/lib: $ CLASSPATH
- Export PATH = $ JAVA_HOME/bin: $ JRE_HOME/bin: $ PATH
After saving and exiting,
$ Source. bashrc
Make it take effect immediately. It takes several hours to download and compile the source code.
3. install and configure eclipse
Download the 64-bit eclipse on the official website and decompress tar zxvf directly. You can run eclipse directly on the terminal. However, if you double-click it, the jre environment is required. You can solve this problem and enter the eclipse directory,
- $ Mkdir jre
- $ Cd jre
- $ Ln-s your JDK directory/bin
You can configure a starter for eclipse. The procedure is as follows:
$ Sudo vim/usr/share/applications/Eclipse. desktop
Add the following content:
- [Desktop Entry]
- Name = Eclipse
- Comment = Eclipse
- Exec = Your eclipse directory/eclipse
- Icon = Your eclipse directory/icon. xpm
- Terminal = false
- Type = Application
- Categories = Application; Development;
In this way, you can see the eclipse shortcut in start-> programming.
Download the SDK and ADT. Click here to download the SDK. Decompress the downloaded tar zxvf file.
ADT in eclipse, Help-> Install New Software. Enter https://dl-ssl.google.com/android/eclipse /. Download all the plug-ins under it. After you restart eclipse, you can specify the SDK directory in your preferences and use SDK Manager to download Tools and sdks of various versions. This is very simple, just like in windows.
4. Import the source code to eclipse and debug System_Process
Refer to this document:Http://www.linuxidc.com/Linux/2012-08/67986.htm. It is more detailed.
In your source directory/development/ide/eclipseunder your guidance you import a few files in eclipse, first read readme.importing-to-eclipse.txt import android. importorder and android-formatting.xml, respectively, representing the package import sequence and code formatting configuration. Next, you can refer to the document. Note: before importing the source code, you must cancel the Eclipse automatic compilation option (set by the Build Project Automatically under the Project in the menu bar). In addition, do not clean the Project after the source code is imported.
The following is how to compile this project. If there are any errors, you can. comment out the corresponding directory in classpath, and then open the simulator and debug the source code using the simulator through Remote Debugging. If the device is not found in ddms, check whether the debug option of the simulator is enabled, in addition, kill adb before start. For more information, see references.