Please note that these Trac pages are no longer being updated. Wiki contents/documentation have moved to GitHub.

Version 10 (modified by justinc, 7 years ago)

--

Building Seattle On Android

This document describes how do build the APK file for Seattle on Android. This package contains the UI for Seattle that is used by the Android users. However, the non-installer Seattle code (i.e. everything in the Linux installer) is downloaded at install time. This is done to make crediting users for donations work smoothly.


Getting the SDK


To build the APK file, you must first download the Android SDK. It is recommended you install every version of Android > 2.1 (API > 7) because Seattle runs on all of these platforms.

To do the installation, download and unzip the file. On some platforms, you then need to run tools/android to do the actual installation and download.


Getting Seattle On Android Ready To Build


The APK source for Seattle On Android is located in SVN under trunk/dist/android/SeattleOnAndroid. You will need to create a local.properties file in this directory which refers to your SDK install location. The contents of this file will look something like this, be sure to replace the sdk.dir with the appropriate one for your system:

target=android-7
sdk.dir=/Users/justincappos/android-sdk-macosx/ 

Do not use '~' characters as ant does not seem to support them well

Now you need to update the project so that it is ready to build. From the SeattleOnAndroid directory, do:

android update project --name SeattleOnAndroid --target android-7 --path . 

The target should match that in the file above.

Note that if android isn't in your path you will need to specify the full path for it.


Building the APK


At this point, you should be able to build the APK by running ant debug from the trunk/dist/android/SeattleOnAndroid directory. This will create a release that is signed with the debug key.

You can also do ant release to create a version of the APK that is ready for release, but is unsigned.


Testing the APK


More to come.


Signing and Distributing the APK

Signing and aligning the release version. These details are from the README. I don't understand them.

jarsigner -keystore <keystore_path> -storepass <keystore_pass> -keypass <key_pass> <apk_path> <key_name> -digestalg SHA1 -sigfile CERT
zipalign <align> -f <unaligned_apk_path> <output_apk_path>

<keystore_path>: path to keystore file
<keystore_pass>: keystore password
<key_pass>: key password
<apk_path>: path to unsigned apk
<key_name>: name of the private key to use

<align>: alignment in bytes, 4 would probably be a good bet
<unaligned_apk_path>: path to signed, but yet unaligned apk
<output_apk_path>: output path for the aligned apk