Version 10 (modified by 12 years ago) (diff) | ,
---|
How To Build BOINC for Android
This document describes, how to build the BOINC Client/Manager? for Android-powered devices.
To learn more about this project and it's architecture, see AndroidBoincImpl
Introduction
Naming convention
BOINC for Android - Android application that bundles a cross compiled BOINC Client together with a Android-specific BOINC Manager (GUI).
BOINC apps - scientific applications to be distributed and calculated on participating devices.
Requirements
- recommended IDE for Android development is Eclipse with ADT plugin
- Android SDK: http://developer.android.com/sdk/
- Android NKD: http://developer.android.com/tools/sdk/ndk/index.html
- BOINC Client source code: http://boinc.berkeley.edu/trac/wiki/SourceCodeGit
Used versions
Development target:
- ARM architecture featuring ABI v5
- NDK-level 9 (Android 2.3)
Tested with:
- ARM ABI v7 device (Samsung Galaxy SII)
- Android platform 2.3.4
Building BOINC Client
Setup NDK toolchain
In order to run the BOINC Client on Android-powered devices, it is necessary to compile it with the according cross compilation toolchain. This toolchain differs depending on the targeted Android platform version and CPU architecture.
The Android NDK offers a script to build a standalone redistributable toolchain, including the binaries of the cross compilation tools and the sysroot (headers and libraries which are present on the targeted Android device, for more information see "Android NDK stable APIs").
Our build scripts depend on the NDKROOT environment variable to point to the installed NDK. Please make sure that environment variable is set before executing the build_androidtc.sh shell script.
Run the following command from the boinc/android directory:
./build_androidtc.sh
This will install a toolchain for ARM devices with minimum Android version 2.3 in the ~/android-tc directory.
A map of NDK Android platform version (e.g. android-9) to common Android versions (e.g. Android 2.3) can be found in under "Stable APIs" of the Android NDK documentation.
Build Client using script
With the compilation toolchain ready, proceed with actually building the BOINC Client. The BOINC repository provides a build script, which sets up the paths and invokes the building tools.
Before first execution, configure the build script with the following information:
- OPENSSL(build_openssl.sh): location of openSSL sources, openSSL is required by BOINC Client. (Tested with version 1.0.0d)
- CURL(build_curl.sh): location of CURL sources, Curl is required by BOINC Client. (Tested with 7.27.0)
Run the following command from the boinc/android directory:
./build_all.sh
To build only the client, run the following command from the boinc/android directory:
./build_boinc.sh
Verify that "boinc" executable was created and copied too boinc/android/BOINC/assets. Note that it will not run on your development machine.
Building BOINC for Android
BOINC for Android consists of an Android-specific BOINC Manager (GUI, written in Java using the Android Application Framework API) bundled with cross compiled BOINC Client binaries (see section 1). This section describes, how to build the Android application.
Setup Android SDK
Step-by-step instructions on how to set up the Android development environment, including Android SDK, development tools, Android platforms, Eclipse and ADT plugin can be found here: http://developer.android.com/sdk/installing/index.html
Building BOINC for Android
Make sure, that the cross compiled BOINC Client resides in your Android project's "assets" directory. Building the Android project in Eclipse will bundle the Client's binaries into the Android application's APK file.
Debugging
Both components of BOINC for Android , the BOINC Client and the BOINC Manager, use Logcat to write debugging messages.
If you are using an Android emulator (AVD) to debug your project, note the following:
- AVD is by default ARM ABI v5.
- AVD does not support wifi, the data connection of the development machine is tunneled to the cellular connection of the emulator. Be adviced, that BOINC for Android's default configuration allows project work unit transfers only when wifi is connected! To change this behavior, go to application's "settings" tab.
- Internal memory and RAM are very little on an AVD. Note that most common Android smartphones have higher capabilities.
To adapt an AVD instance, in terms of available RAM, internal memory, Android platform version or ARM ABI version, see: http://developer.android.com/tools/devices/index.html
Next steps
- build your scientific BOINC apps for Android. Keep in mind, that the Android platform and architecture settings have to be the same for both, the BOINC for Android and the BOINC apps. The compatibility of the device gets only checked, when BOINC for Android is installed on a device, unsupported scientific apps will not be detected and are likely to crash on some devices. Use "BOINC platform" configuration of the build script, to distinct versions with project scheduler.