Changes between Initial Version and Version 1 of AndroidBuildClient


Ignore:
Timestamp:
Aug 5, 2012, 12:29:08 AM (12 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AndroidBuildClient

    v1 v1  
     1[[PageOutline]]
     2= How To Build AndroidBOINC =
     3
     4This document describes, how to build the BOINC Client/Manager AndroidBOINC
     5for Android-powered devices.
     6
     7To learn more about this project and it's architecture, see *link*
     8
     9
     10= Introduction =
     11
     12== Naming convention ==
     13
     14AndroidBOINC - Android application that bundles a cross compiled BOINC Client
     15together with a Android-specific BOINC Manager (GUI).
     16BOINC apps - scientific applications to be distributed and
     17calculated on participating devices.
     18
     19
     20== Requirements ==
     21
     22 * recommended IDE for Android development is Eclipse with ADT plugin
     23 * Android SDK: http://developer.android.com/sdk/
     24 * Android NKD: http://developer.android.com/tools/sdk/ndk/index.html
     25 * BOINC Client source code: http://boinc.berkeley.edu/trac/wiki/SourceCode
     26 * AndroidBOINC source code: http://boinc.berkeley.edu/trac/wiki/SourceCode
     27 * AndroidBOINC build script: *link*
     28
     29
     30== Used versions ==
     31
     32Development target:
     33 * ARM architecture featuring ABI v5
     34 * NDK-level 4 (Android 1.6)
     35
     36Tested with:
     37 * ARM ABI v7 device (Samsung Galaxy SII)
     38 * Android platform 2.3.4
     39
     40
     41= Building BOINC Client =
     42
     43== Setup NDK toolchain ==
     44
     45In order to run the BOINC Client on Android-powered devices,
     46it is necessary to compile it with the according cross compilation toolchain.
     47This toolchain differs depending on the targeted Android platform version
     48and CPU architecture.
     49
     50The Android NDK offers a script to build a standalone redistributable toolchain,
     51including the binaries of the cross compilation tools and the sysroot
     52(headers and libraries which are present on the targeted Android device,
     53for more information see "Android NDK stable APIs").
     54To do so, run the following command from the Android NDK root directory:
     55{{{
     56build/tools/make-standalone-toolchain.sh --platform=android-4 --install-dir=/tmp/tc
     57}}}
     58This will install a toolchain for ARM devices
     59(default, use e.g. "--arch=x86" to change) with minimum Android version 1.6
     60in the given installation directory.
     61
     62A map of NDK Android platform version (e.g. android-4)
     63to common Android versions (e.g. Android 1.6) can be found in under "Stable APIs"
     64of the Android NDK documentation.
     65
     66
     67== Build Client using script ==
     68
     69With the compilation toolchain ready, proceed with actually building the BOINC Client.
     70The BOINC repository provides a build script,
     71which sets up the paths and invokes the building tools.
     72
     73Before first execution, configure the build script with the following information:
     74
     75 * BPNAME: name of the BOINC platform.
     76  This can be use to distinct different Android architecutres or platform
     77  versions by your project's scheduler. (use e.g. "android-arm-4")
     78 * ANDROIDTC: location of the standalone toolchain, set up in 1.1
     79 * OPENSSL: location of openSSL sources, openSSL is required by BOINC Client.
     80  (Tested with version 1.0.0d)
     81 * CURL: location of CURL sources, Curl is required by BOINC Client.
     82  (Tested with 7.27.0)
     83 * BOINC: location of BOINC sources, no adjustments for Android necessary,
     84  use source code from BOINC repository
     85 * BAPP: location of BOINC app, optional. Not required to build the Client.
     86 * BOINCINSTALL: destination directory for BOINC binaries.
     87 * TARGETAPK: location of AndroidBOINC sources.
     88  Script copies the BOINC Client binary to the Android project's "assets" directory.
     89
     90Run script and verify that "boinc_client" executable got created.
     91Note that it will not run on your development machine, if you target the ARM architecture.
     92
     93
     94= Building AndroidBOINC =
     95
     96AndroidBOINC consists of an Android-specific BOINC Manager
     97(GUI, written in Java using the Android Application Framework API)
     98bundled with cross compiled BOINC Client binaries (see section 1).
     99This section describes, how to build the Android application.
     100
     101
     102== Setup Android SDK ==
     103
     104Step-by-step instructions on how to set up the Android development environment,
     105including Android SDK, development tools, Android platforms,
     106Eclipse and ADT plugin can be found here:
     107http://developer.android.com/sdk/installing/index.html
     108
     109
     110== Customize AndroidBOINC ==
     111
     112AndroidBOINC is able to attach to a single project only.
     113This is a limitation of the Android Manager, rather then the BOINC Client.
     114In order to provide AndroidBOINC for your project,
     115the very basic modifications to the Android app are:
     116
     117 *  adapt the default project URL & name
     118  (located at *android.package.name*/res/values/strings.xml)
     119
     120Of course you are free to adapt the Manager to suit the needs of your project, e.g.:
     121 *  rename application
     122 *  adapt graphical identity
     123 *  translate to other language
     124
     125If you make major improvements to AndroidBOINC,
     126please consider sharing them with the community!
     127
     128
     129== Remarks on changing package name ==
     130
     131If you want to change the Android application's package name,
     132be advised that you also have to adapt the working directory
     133in the sources of the BOINC Client.
     134The working directory is defined in *boinc-client-sources*/lib/android_log.h.
     135
     136The working directory is defined with the pattern:
     137"/data/data/*android.package.name*/client"
     138
     139Re-compile BOINC Client for changes to take effect.
     140
     141
     142== Building Android BOINC Manager ==
     143
     144Make sure, that the cross compiled BOINC Client resides in your Android project's
     145"assets" directory.
     146Building the Android project in Eclipse will bundle the Client's binaries
     147into the Android application's APK file.
     148
     149
     150= Debugging =
     151
     152Both components of AndroidBOINC, the BOINC Client and the BOINC Manager,
     153use Logcat to write debugging messages.
     154
     155If you are using an Android emulator (AVD) to debug your project, note the following:
     156
     157 * AVD is by default ARM ABI v5.
     158 * AVD does not support wifi, the data connection of the development machine
     159  is tunneled to the cellular connection of the emulator.
     160  Be adviced, that AndroidBOINC's default configuration allows
     161  project work unit transfers only when wifi is connected!
     162  To change this behavior, go to application's "settings" tab.
     163 * Internal memory and RAM are very little on an AVD.
     164  Note that most common Android smartphones have higher capabilities.
     165
     166To adapt an AVD instance, in terms of available RAM, internal memory,
     167Android platform version or ARM ABI version, see:
     168http://developer.android.com/tools/devices/index.html
     169
     170
     171= Next steps =
     172
     173 * build your scientific BOINC apps for Android (see *link*).
     174   Keep in mind, that the Android platform and architecture settings
     175   have to be the same for both, the AndroidBOINC and the BOINC apps.
     176   The compatibility of the device gets only checked,
     177   when AndroidBOINC is installed on a device, unsupported scientific apps
     178   will not be detected and are likely to crash on some devices.
     179   Use "BOINC platform" configuration of the build script,
     180   to distinct versions with project scheduler.
     181 * configure project scheduler to distribute BOINC apps for AndroidBOINC.
     182 * submit AndroidBOINC to an app store or distribute APK independently.