This is the phone component of the e-mission system.
:sparkles: This has now been upgraded to cordova android@9.0.0 and iOS@6.0.1 (details). It has also been upgraded to android API 29, cordova-lib@10.0.0 and the most recent node and npm versionsIt also now supports CI, so we should not have any build issues in the future. The limitations from the previous upgrade have all been resolved. This should be ready to build out of the box, after all the configuration files are changed.
Additional documentation has been moved to its own repository e-mission-docs. Specific e-mission-phone wikis can be found here: https://github.com/e-mission/e-mission-docs/tree/master/docs/e-mission-phone
Issues: Since this repository is part of a larger project, all issues are tracked in the central docs repository. If you have a question, as suggested by the open source guide, please file an issue instead of sending an email. Since issues are public, other contributors can try to answer the question and benefit from the answer.
If you want to make only UI changes, (as opposed to modifying the existing plugins, adding new plugins, etc), you can use the new and improved (as of June 2018) e-mission dev app.
Run the setup script
$ bash setup/setup_serve.sh
(optional) Configure by changing the files in www/json
.
Defaults are in www/json/*.sample
$ ls www/json/*.sample
$ cp www/json/startupConfig.json.sample www/json/startupConfig.json
$ cp ..... www/json/connectionConfig.json
$ source setup/activate_serve.sh
Start the phonegap deployment server and note the URL(s) that the server is listening to.
$ npm run serve
....
[phonegap] listening on 10.0.0.14:3000
[phonegap] listening on 192.168.162.1:3000
[phonegap]
[phonegap] ctrl-c to stop the server
[phonegap]
....
Change the devapp connection URL to one of these (e.g. 192.168.162.1:3000) and press "Connect"
The app will now display the version of e-mission app that is in your local directory
[console]
)Ta-da! :gift: If you change any of the files in the www
directory, the app will automatically be re-loaded without manually restarting either the server or the app :tada:
Note1: You may need to scroll up, past all the warnings about Content Security Policy has been added
to find the port that the server is listening to.
A lot of the visualizations that we display in the phone client come from the server. In order to do end to end testing, we need to run a local server and connect to it. Instructions for:
are available in the e-mission-server README.
In order to make end to end testing easy, if the local server is started on a HTTP (versus HTTPS port), it is in development mode. By default, the phone app connects to the local server (localhost on iOS, 10.0.2.2 on android) with the prompted-auth
authentication method. To connect to a different server, or to use a different authentication method, you need to create a www/json/connectionConfig.json
file. More details on configuring authentication can be found in the docs.
One advantage of using skip
authentication in development mode is that any user email can be entered without a password. Developers can use one of the emails that they loaded test data for in step (3) above. So if the test data loaded was with -u shankari@eecs.berkeley.edu
, then the login email for the phone app would also be shankari@eecs.berkeley.edu
.
android SDK; install manually or use setup script below. Note that you only need to run this once per computer.
$ bash setup/prereq_android_sdk_install.sh
homebrew
Most of the recent issues encountered have been due to incompatible setup. We have now:
If you have setup failures, please compare the configuration in the passing CI builds with your configuration. That is almost certainly the source of the error.
Run the setup script for the platform you want to build
$ bash setup/setup_android_native.sh
AND/OR
$ bash setup/setup_ios_native.sh
(optional) Configure by changing the files in www/json
.
Defaults are in www/json/*.sample
$ ls www/json/*.sample
$ cp www/json/startupConfig.json.sample www/json/startupConfig.json
$ cp ..... www/json/connectionConfig.json
$ source setup/activate_native.sh
If connecting to a development server over http, make sure to turn on http support on android
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true"/>
</edit-config>
$ npx cordova emulate ios
AND/OR
$ npx cordova emulate android
If you are building your own version of the app, you must have your own logo to
avoid app store conficts. Updating the logo is very simple using the ionic cordova resources
command.
Note: You may have to install the cordova-res
package for the command to work
npx ionic
and npx cordova
. This is
because the setup script installs all the modules locally in a self-contained
environment using npm install
and not npm install -g
rm -rf node_modules && npm install
rm -rf plugins && rm -rf platforms && npx cordova prepare
If users run into problems, they have the ability to email logs to the
maintainer. These logs are in the form of an sqlite3 database, so they have to
be opened using sqlite3
. Alternatively, you can export it to a csv with
dates using the bin/csv_export_add_date.py
script.
<download the log file>
$ mv ~/Downloads/loggerDB /tmp/logger.<issue>
$ pwd
.../e-mission-phone
$ python bin/csv_export_add_date.py /tmp/loggerDB.<issue>
$ less /tmp/loggerDB.<issue>.withdate.log
Add the main repo as upstream
$ git remote add upstream https://github.com/covid19database/phone-app.git
Create a new branch (IMPORTANT). Please do not submit pull requests from master
$ git checkout -b mybranch
Make changes to the branch and commit them
$ git commit
Push the changes to your local fork
$ git push origin mybranch
Generate a pull request from the UI
Address my review comments
Once I merge the pull request, pull the changes to your fork and delete the branch
$ git checkout master
$ git pull upstream master
$ git push origin master
$ git branch -d mybranch