Build eclipse Environment
1. Download eclipse
Sudo apt-Get install eclipse
2. Download the ADT and restart it.
A. Start eclipse, and select help> Software Updates> Find and install ....
B. When the dialog box appears, select search for new features to install and click Next.
C. Click new remote site.
D. In the result dialog box, enter the name of the remote site (for example, Android plugin) and enter the site as follows:
Https://dl-ssl.google.com/android/eclipse/site.xmlclick OK.
3. Load the SDK
A. Select WINDOW> preferences... To open the properties Panel. (Mac OS X: Eclipse> preferences)
B. Select android from the left-side navigation pane.
C. Locate the SDK on the main interface and Click Browse... Then locate the SDK folder.
D. Click Apply and then click OK.
4. Create an android project to debug the application.
Part 4: load the android source code as the Eclipse project and debug it
1. Enter the development/IDE/eclipse under the source code directory, copy the android-formatting.xml Android. importorder. classpath to the source code directory
2. Grant the execution permission to chmod + X. classpath.
3. In the Eclipse project menu window --> preferences --> JAVA --> code style --> formatter import android-formatting.xml file, organize imports import Android. importorder File
4. Create a Java project and import the android source code.
5. Modify the eclipse configuration, which is located in the eclipse. ini file under the Android. importorder directory. Modify-XMS,-xmx to 128 and 512.
-Xms128m
-Xmx512m
Debugging:
1. Exit the Eclipse project
2. Run. Build/envsetup. Sh In the android source code directory.
3. Start emulator &
4. After the simulator is started successfully, start ddms &
5. Select a process. Be sure to select
6. Start eclipse and configure debugging information.
7. set breakpoints and start debugging.
Part 5: add an app as an Android app
1. Develop your own Android Application under the SDK directory of the same version as the system
2. Put the developed Android project under the packages/apps/directory of the source code.
3. Add the Android. mk file in the project directory, modify local_package_name: = test001, set the project name to your project name, and the project I load to test001.
Local_path: = $ (call my-DIR)
Include $ (clear_vars)
Local_module_tags: = user
Local_src_files: = $ (call all-Java-files-under, Src)
Local_static_java_libraries: = googlelogin-Client
Local_package_name: = test001
Local_certificate: = shared
Include $ (build_package)
# Use the folloing include to make our test APK.
Include $ (call all-makefiles-under, $ (local_path ))
4. Return to the source code directory and execute. Build/envsetup. Sh. Note that there is a space behind Sh.
5. Run Mmm packages/apps/test001 to compile the test001.apk package.
6. Execute make Snod and compile the system. IMG package.
7. Execute emulator and you will be able to see the project you have compiled in the application.
Part 6: how to modify the Contact application based on the android source code and add your own activity
1. Create an android project and load your own java files and resource files.
2. After the preliminary debugging of your android project is successful, copy the Java file and resource file of the project to the corresponding Java file and resource file directory of the contact.
3. Then, run the following command in Linux to compile the contact module and compile the resource file into the contact directory.
. Build/envsetup. Sh
Mmm packages/apps/contacts
4. Refresh the android source code project. At this time, you can view the newly added resource files and source files in the contacts package directory. You can modify the code under the source code project and debug it directly.
5 .?? Why not add source files and XML resource files directly under the android source code project ????
A: Because our android source code engineer imported it using a Java project, if the android XML file is added, the Java program cannot identify the resource R file, so we must first
XML resource files are first compiled in Linux
6. after modifying the source code project, you can execute the contact compilation command again in Linux and make Snod to load the system. imgfile, and start the emulator &) to view your modifications.
Part 1: Basic Structure of the contacts Application
Main portal program: dialtactsactivity. Java
Start function:
Protected void oncreate (bundle icicle ){
Super. oncreate (icicle );
Final intent = getintent ();
Fixintent (intent );
// Hide title
Requestwindowfeature (window. feature_no_title );
Setcontentview (R. layout. dialer_activity );
/* Initialize the tab Layout */
Mtabhost = gettabhost ();
// Set the tab Change Notification
Mtabhost. setontabchangedlistener (this );
// Set the dial Tab
Setupdialertab ();
// Set the call log Tab
Setupcalllogtab ();
// Set the contact Tab
Setupcontactstab ();
// Set the favorite Tab
Setupfavoritestab ();
// Set the tab page currently displayed
Setcurrenttab (intent );
/*???? */
If (intent. getaction (). Equals (ui. filter_contacts_action)
& Icicle = NULL ){
Setupfiltertext (intent );
}
}
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/zhangweia/archive/2010/07/19/5745671.aspx
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/c8051f330/archive/2010/11/26/6038474.aspx