Skip to content
Jesse Vincent edited this page Feb 1, 2011 · 8 revisions

#How to build the project

Introduction

K-9 Mail targets Java 1.5 (but we're using Java 1.6 @Override annotations, so a Java 1.6 compiler is needed).

K-9 Mail runs on Android 1.5 and newer versions. Currently SDK 2.2 is needed to build the code because we dynamically load classes with API 4/5/6/7/8 code if the platform supports it.

Building with ant

To build

  • Create a file called 'local.properties' at the root of the source tree with the following entry {{{ sdk.dir=/path/to/android-sdk-linux }}}

  • # ant debug

To install on your simulator or local device

# adb install -r bin/K9-debug.apk

To build and sign the project for upload to the marketplace

You'll need a few new entries in your local.properties:

{{{ gcode-user=yourname gcode-pass=your-secret-token }}}

You'll also need googlecode_upload.pl from http://search.cpan.org/dist/Google-Code-Upload/

Edit AndroidManifest.xml to increment the versionCode and versionName

ant clean release

Check in and tag your new version number

Test on actual device hardware

Upload to the market

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. Now...

Inside your working copy, make sure you have a directory named 'gen'

From Eclipse, File > Import

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

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

Click Finish

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

Select 'Java Compiler'

Check 'Enable project specific settings'

Set the 'Compiler compliance level' to 1.6

Click OK

You should now be able to build the project. If it had been built previously, make sure you clean it first.

To install on your simulator or local device

Go to Run->Run Configurations, click Android Application then click the "new" icon (sheet with plus sign) Change the name to your liking, then click the brows button and select the K9 project. Click OK.

On subsequent runs, you can click Run->Run History and then click the name of your Run Configuration.

Clone this wiki locally