16 | | |
17 | | In terms of software, our goals include: |
18 | | |
19 | | * A BOINC client and GUI that we (BOINC project staff) |
20 | | can cross-compile on Linux, and can debug using an Android emulator. |
21 | | * The source code for both of these in the BOINC repository, |
22 | | with the copyright assigned to UCB. |
23 | | * The client can download apps from projects or use the anonymous platform mechanism. |
24 | | * A "cookbook" set of instructions allowing existing C++ applications |
25 | | to be cross-compiled on Linux for Android/ARM. |
26 | | * Scripts for creating an Android installer for the generic BOINC client, |
27 | | using the BOINC graphical identity. |
28 | | * Scripts for creating an Android installer for a package that includes the |
29 | | BOINC client configured to attach to a particular project, |
30 | | using the graphical identity of that project. |
31 | | * Cookbooks for putting these installers on several Android app stores. |
65 | | I'm currently investigating this. |
66 | | |
67 | | == Architecture == |
68 | | |
69 | | As of now, the preferred architecture is based on the standard BOINC client, |
70 | | so that we can allow multiple attachments, multiple jobs running in parallel, |
71 | | and queued jobs. |
72 | | |
73 | | On !Win/Mac/Linux, the GUI and the client are separate processes that |
74 | | communicate over a TCP connection. |
75 | | However (as proposed by Peter Hanappe) for Android it's probably better |
76 | | to bundle them in the same program. |
77 | | The BOINC client would be included as a library, |
78 | | and would run in a separate thread. |
79 | | |
80 | | == What about the GUI? == |
81 | | |
82 | | The current BOINC GUI (the Manager) is implemented using !WxWidgets, |
83 | | for which no port to Android exists. |
84 | | Also, though the Manager's "simple view" is similar to what |
85 | | we might want on Android, it's not quite right. |
86 | | |
87 | | So the plan is to implement a new GUI, in Java, using the Android toolkit, |
88 | | which will communicate with the client using the existing GUI RPC mechanism. |
89 | | (Note: this mechanism currently uses a TCP connection, but it could be modified |
90 | | to use Unix pipes or some other IPC mechanism). |
91 | | |
92 | | We maybe able to use some or all of AndroBOINC; |
93 | | I've contacted its author asking about the status of its source code. |
94 | | |
95 | | == Security == |
96 | | |
97 | | Carl tells me that Android doesn't let apps download and execute code. |
98 | | We need to investigate this. |
99 | | If so, we could |
100 | | |
101 | | * Convince Google to provide a workaround for us (unlikely). |
102 | | * Switch to a model where volunteers download an app that includes |
103 | | (as libraries) all the app versions of all projects. |
104 | | This is non-ideal but it wouldn't be the end of the world. |
105 | | |
106 | | Peter thinks it may be possible for the client to download .so |
107 | | files and dynamically link them with ldopen(). |
108 | | If so apps could be packaged as .so files. |
109 | | Also, in this case it would be possible to run the apps in threads |
110 | | within the client; |
111 | | this would avoid reported problems with fork(). |
112 | | |
113 | | == Building apps == |
114 | | |
115 | | What's the easiest way for projects to compile existing apps for ARM/Android? |
116 | | |
117 | | == Packaging == |
118 | | |
119 | | I think that what users see in Android app stores should be |
120 | | branded with a particular project's identity, |
121 | | rather than a generic BOINC identity. |
122 | | When the volunteer first runs the app they're prompted |
123 | | for email/password on that project |
124 | | (this could be made optional, in which case we'd create |
125 | | an anonymous account for them). |
| 48 | was released. |
| 49 | This consists of modified versions of the BOINC client (based on 6.10.58) |
| 50 | and AndroBOINC, |
| 51 | together with Android versions of several applications. |
153 | | * Get the scripts/makefiles for building SETI@home for Android |
154 | | into the SETI@home repository, |
155 | | and make an Android/ARM app version available on SETI@home. |
156 | | (Jeff, Eric) |
| 77 | * A BOINC client and GUI that we (BOINC project staff) |
| 78 | can cross-compile on Linux, and can debug using an Android emulator. |
| 79 | * The source code for both of these in the BOINC repository, |
| 80 | with the copyright assigned to UCB. |
| 81 | * The client can download apps from projects or use the anonymous platform mechanism. |
| 82 | * A "cookbook" set of instructions allowing existing C++ applications |
| 83 | to be cross-compiled on Linux for Android/ARM. |
| 84 | * Scripts for creating an Android installer for the generic BOINC client, |
| 85 | using the BOINC graphical identity. |
| 86 | * Scripts for creating an Android installer for a package that includes the |
| 87 | BOINC client configured to attach to a particular project, |
| 88 | using the graphical identity of that project. |
| 89 | * Cookbooks for putting these installers on several Android app stores. |
172 | | We'll do communication only over wifi. |
| 119 | The client will run apps as follows: |
| 120 | * Link the .so file using dlopen() if it's not already linked. |
| 121 | * Create a PTHREAD_APP_INFO structure, which contains control and status info. |
| 122 | * Create a pthread, running the .so's '''app_start''' function, |
| 123 | and passing to it a pointer to the PTHREAD_APP_INFO structure. |
| 124 | |
| 125 | Process control operations (suspend, resume, quit, abort, check completion) |
| 126 | will be implemented differently than other platforms. |
| 127 | For example, the client will suspend an app by setting a flag |
| 128 | in the PTHREAD_APP_INFO and sending the thread a SIGUSR1 signal. |
| 129 | The handler for this signal will sleep until the flag is cleared. |
| 130 | |
| 131 | This architecture has some drawbacks, of course: |
| 132 | |
| 133 | * If any app crashes or exits, so does the entire client. |
| 134 | (We may be able to minimize this risk by installing signal handlers in the app thread.) |
| 135 | * If an app trashes memory, it may crash the entire client. |
| 136 | * For now, we can't support multithreaded apps. |
| 137 | |
| 138 | TO BE DETERMINED: can the client map in the .so file, then fork()? |
| 139 | That would allow apps to be run in separate processes. |
| 140 | |
| 141 | === GUI === |
| 142 | |
| 143 | The current BOINC GUI (the Manager) is implemented using !WxWidgets, |
| 144 | for which no port to Android exists. |
| 145 | Also, though the Manager's "simple view" is similar to what |
| 146 | we might want on Android, it's not quite right. |
| 147 | AndroBOINC's GUI is probably a bit too "techie". |
| 148 | So we plan to implement a new GUI, in Java, using the Android toolkit. |
| 149 | |
| 150 | On Android, some functions (e.g. checking CPU temperature and battery life) |
| 151 | are available in Java but not C++. |
| 152 | So we'll do these things in the GUI, |
| 153 | and create GUI RPCs for passing the info to the client. |
| 154 | |
| 155 | === Building apps === |
| 156 | |
| 157 | We'll provide a cookbook for cross-compiling apps on Linux. |
| 158 | |
| 159 | === Packaging === |
| 160 | |
| 161 | It's desirable that what users see in Android app stores is |
| 162 | branded with a particular project's identity, |
| 163 | rather than a generic BOINC identity. |
| 164 | When the volunteer first runs the app they're prompted |
| 165 | for email/password on that project |
| 166 | (this could be made optional, in which case we'd create |
| 167 | an anonymous account for them). |
| 168 | |
| 169 | === Technical issues === |
| 170 | |
| 171 | Power management turns the CPU to low power usage |
| 172 | (1/10 clock rate or slower) when user not active. |
| 173 | |
| 174 | Reduced battery lifetime if left plugged in all the time. |
| 175 | |