Android 使用Eclipse 构建K9

来源:互联网 发布:java 异常堆栈信息 编辑:程序博客网 时间:2024/04/30 18:45

Building with Eclipse

You'll need Eclipse with the Android Development Tools plugin installed. Follow the full directions found here:http://developer.android.com/sdk/eclipse-adt.html#installing. Make sure your Android SDK and ADT plugin are both up to date.

Building K-9 can take up to 1 GB of memory. You have to allow Eclipse to use this amount of memory or you will get out-of-memory errors when the Android compilers are run. In order to do this, edit your eclipse.ini file and make sure the following arguments are present: -vmargs -Xms128m -Xmx1024m

You can also pass these parameters to Eclipse on the command line.

To set up Eclipse to build K-9 Mail we need two projects. The first one is the ActionBarSherlock project and the second one is K-9 Mail. We'll set them up in that order too:

  1. Open Eclipse and choose File->New->Project
  2. Choose Android Project
  3. Select Create project from existing source and then browse to PROJECTFOLDER/plugins/ActionBarSherlock/library folder.
  4. Finish the wizard, then right click on the newly created project in the Package Explorer and select 'properties'.
  5. Under the Android options, you see a section 'Library' with a checkbox IsLibrary. Make sure that's checked.
  6. Clean and build this library project.
  7. Select Create project from existing source and then browse to PROJECTFOLDER/plugins/Android-PullToRefresh/library folder.
  8. Finish the wizard, then right click on the newly created project in the Package Explorer and select 'properties'.
  9. Under the Android options, you see a section 'Library' with a checkbox IsLibrary. Make sure that's checked.
  10. Clean and build this library project.

  11. Inside your PROJECTFOLDER, make sure you have a directory named 'gen'

  12. From Eclipse, File > Import

  13. Under General, select 'Existing Projects into Workspace' and click Next

  14. Next to 'Select root directory', Browse to your K-9 working copy

  15. Click Finish

  16. In the Package Explorer, right click 'k9mail' and click 'Properties'

  17. Select 'Android' again and then click 'Add'.

  18. Now add the previously created library project to this project.

  19. Select 'Java Compiler'

  20. Check 'Enable project specific settings'

  21. Set the 'Compiler compliance level' to 1.6

  22. Click OK

You should now be able to build the project. If it had been built previously, make sure you clean it first. If you get errors about missing translation information for some locales, go to Project -> Properties -> Android Lint Settings and change the severity of MissingTranslations to Warning.


原创粉丝点击