例如,packages/apps/Phone的源代码,这应该是比较核心的一个程序这个源代码好像不能直接用eclipse导入创建,会提示和模拟器中的Phone程序产生冲突小白我很想了解这些程序的作者当时是用什么工具,怎么写出来这些程序的,然后又怎么维护这些程序

解决方案 »

  1.   

    source /build/evn_setup.sh
    mmm package/app/Email
      

  2.   

    想知道更多 就得抛弃eclipse 
    回归Linux 拿着完整的源码想事情
      

  3.   

    在linux下,加log,编译,push到手机,看log。
      

  4.   

    你试着到模拟器的system/app下面看看,把Phone.apk删除了,然后再把你的程序push到这里,然后调试
      

  5.   

    Phone模块编译的时候和一般的 package/app 的应用不一样,
    Phone编译需要重新编译整个system
      

  6.   

    http://source.android.com/source/using-eclipse.htmlBasic setupFirst, it's important to make sure the regular Android development system is set up.cd /path/to/android/root 
    makeImportant: You will still be using make to build the files you will actually run (in the emulator or on a device). You will be using Eclipse to edit files and verify that they compile, but when you want to run something you will need to make sure files are saved in Eclipse and run make in a shell. The Eclipse build is just for error checking.Eclipse needs a list of directories to search for Java files. This is called the "Java Build Path" and can be set with the .classpath file. We have a sample version to start you off.cd /path/to/android/root 
    cp development/ide/eclipse/.classpath .
    chmod u+w .classpathNow edit that copy of .classpath, if necessary.Now start Eclipse:eclipseNow create a project for Android development:   1.      If Eclipse asks you for a workspace location, choose the default.
       2.      If you have a "Welcome" screen, close it to reveal the Java perspective.
       3.      File > New > Java Project
       4.      Pick a project name, "android" or anything you like.
       5.      Select "Create project from existing source", enter the path to your Android root directory, and click Finish.
       6.      Wait while it sets up the project. (You'll see a subtle progress meter in the lower right corner.)Once the project workspace is created, Eclipse should start building. In theory, it should build with no errors and you should be set to go. If necessary, uncheck and re-check Project Build Automatically to force a rebuild.Note: Eclipse sometimes likes to add an import android.R statement at the top of your files that use resources, especially when you ask eclipse to sort or otherwise manage imports. This will cause your make to break. Look out for these erroneous import statements and delete them.
    When You SyncEvery time you repo sync, or otherwise change files outside of Eclipse (especially the .classpath), you need to refresh Eclipse's view of things:   1.      Window > Show View > Navigator
       2.      In the Navigator, right-click on the project name
       3.      Click Refresh in the context menuAdding Apps to the Build PathThe default .classpath includes the source to the core system and a sample set of apps, but might not include the particular app you may want to work on. To add an app, you must add the app's source directory. To do this inside Eclipse:   1.      Project > Properties
       2.      Select "Java Build Path" from the left-hand menu.
       3.      Choose the "Source" tab.
       4.      Click "Add Folder..."
       5.      Add your app's src directory.
       6.      Click OK.When you're done, the "source folder" path in the list should look likeandroid/packages/apps/YOURAPP/srcDepending on which app(s) you include, you may also need to include othersrc/main/java directories under android/dalvik/libcore. Do this if you find you cannot build with the default set.
    Eclipse formattingYou can import files in development/ide/eclipse to make Eclipse follow the Android style rules.   1.      Select Window > Preferences > Java > Code Style.
       2.      Use Formatter > Import to import android-formatting.xml.
       3.      Organize Imports > Import to import android.importorder.Debugging the emulator with EclipseYou can also use eclipse to debug the emulator and step through code. First, start the emulator running:cd /path/to/android/root 
    . build/envsetup.sh 
    lunch 1    
    make       
    emulatorIf the emulator is running, you should see a picture of a phone.In another shell, start DDMS (the Dalvik debug manager):cd /path/to/android/root 
    ddmsYou should see a splufty debugging console.Now, in eclipse, you can attach to the emulator:   1.      Run > Open Debug Dialog...
       2.      Right-click "Remote Java Application", select "New".
       3.      Pick a name, i.e. "android-debug" or anything you like.
       4.      Set the "Project" to your project name.
       5.      Keep the Host set to "localhost", but change Port to 8700.
       6.      Click the "Debug" button and you should be all set.Note that port 8700 is attached to whatever process is currently selected in the DDMS console, so you need to sure that DDMS has selected the process you want to debug.You may need to open the Debug perspective (next to the "Java" perspective icon in the upper-right, click the small "Open Perspective" icon and select "Debug"). Once you do, you should see a list of threads; if you select one and break it (by clicking the "pause" icon), it should show the stack trace, source file, and line where execution is at. Breakpoints and whatnot should all work.结贴给分!