| 1 | = AndroidBOINC = |
| 2 | |
| 3 | AndroidBOINC is an attempt to port the |
| 4 | Berkeley Open Infrastructure for Network Computing to Android-powered devices. |
| 5 | |
| 6 | The Android application consists of the regular BOINC Client |
| 7 | and an Android-specific BOINC Manager. |
| 8 | Using AndroidBOINC, BOINC projects can distribute scientific tasks |
| 9 | to Android-powered devices, |
| 10 | enabling volunteers to contribute CPU time of modern smartphones and tablet computers. |
| 11 | |
| 12 | |
| 13 | == Architecture == |
| 14 | |
| 15 | AndroidBOINC combines the two independent BOINC components of Client and Manager. |
| 16 | |
| 17 | The BOINC Client got adapted to accommodate the needs of mobile devices |
| 18 | and can be cross compiled to run on ARM-Android-based devices. |
| 19 | To allow volunteers to control the Client, |
| 20 | AndroidBOINC's second component is a BOINC Manager, |
| 21 | developed for Android using the common design patterns. |
| 22 | AndroidBOINC bundles those two components together, to be distributed in a single APK. |
| 23 | |
| 24 | Client and Manager communicate via RPCs, similar to versions on Windows or Linux. |
| 25 | |
| 26 | On startup the Android application executes the BOINC Client, |
| 27 | which does not have Android-specific methods implemented and consists |
| 28 | solely out of native source code. |
| 29 | The Client and Manager run as two separate processes. |
| 30 | |
| 31 | |
| 32 | === Aspects of Android platform === |
| 33 | |
| 34 | * Storage: |
| 35 | Applications are only allowed to write into two areas of a device's storage space. |
| 36 | One is the app's directory, located at /data/data/*package.name*/, |
| 37 | files in this directory can be set executable and run using the Java's |
| 38 | Runtime.exec command. |
| 39 | This space is "private", so only accessible by the application it belongs to. |
| 40 | The second storage location is the device SD card (if present), |
| 41 | this is generally accessible by all applications, but mounted non-executable. |
| 42 | |
| 43 | * Permissions: |
| 44 | Android restricts access to certain features with its permission system. |
| 45 | Required permissions have to be declared in the AndroidManifest.xml file by the developer, |
| 46 | the user then gets prompted to grant access upon installation. |
| 47 | AndroidBOINC requires the "Network" permission, |
| 48 | for transmitting workunits and also for the RPC communication in-between Manager and Client. |
| 49 | This permission is granted to the App-specific Linux User ID, |
| 50 | and therefore also applies to its child-processes. |
| 51 | |
| 52 | * Lifecycle: |
| 53 | Applications which are not visible at the moment can get killed by the system. |
| 54 | If the user navigates back to a destroyed application, it gets reactivated. |
| 55 | In most cases according lifecycle-methods are called, however those are not reliable. |
| 56 | This behavior only applies to applications which are executed in Android's |
| 57 | Dalvik virtual machine and not to native child-processes like the BOINC Client. |
| 58 | As a consequence, the Manager tries to connect to a possibly existing BOINC Client. |
| 59 | Only if this attempt fails, a new instance of the BOINC client is executed. |
| 60 | |
| 61 | * Distribution: |
| 62 | Like every other application, AndroidBOINC comes in an APK package. |
| 63 | The BOINC Client gets distributed as part of the Android app and resides |
| 64 | in its "assets" directory. |
| 65 | When executed, the Client gets copied to the local storage space and executed from there. |
| 66 | |
| 67 | |
| 68 | === Considerations for mobile devices === |
| 69 | |
| 70 | In order to accommodate the limitations of mobile devices, |
| 71 | two features got introduced to the BOINC Client: |
| 72 | |
| 73 | * Wifi detection: AndroidBOINC, by default, does communication with its project scheduler |
| 74 | only when logged into a Wifi. |
| 75 | This helps volunteers keeping control of limitations on a data plan. |
| 76 | |
| 77 | * Charging only: AndroidBOINC, by default, computes tasks |
| 78 | only when the device is being connected to a power source, preventing battery drowns. |
| 79 | |
| 80 | |
| 81 | == Acknowledgements == |
| 82 | |
| 83 | * Pavol Michalec for his work on AndroBOINC (BOINC Manager for Android) |
| 84 | |
| 85 | * Mats for his work on NativeBOINC |
| 86 | |
| 87 | |
| 88 | == Getting Started == |
| 89 | |
| 90 | To get your project running on Android, please note: |
| 91 | |
| 92 | * [AndroidBoincClient Build AndroidBOINC] |
| 93 | |
| 94 | * [AndroidBoincApps Build apps for AndroidBOINC] |
| 95 | |