Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded rciti #825

Open
wants to merge 202 commits into
base: rciti
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
99fe9ec
Try to fix the new Label UI walkthrough bug
GabrielKS Aug 20, 2021
62da14c
Try to fix the walkthrough again
shankari Sep 22, 2021
df469f0
Merge pull request #796 from shankari/walkthrough_master_fix
shankari Sep 22, 2021
9a6bd26
Create a very simple directive and include it in the list view
shankari Sep 27, 2021
89da98f
Have the directive include the actual functionality instead of a plac…
shankari Sep 27, 2021
94d1dc9
Add a "next" pointer to each trip
shankari Sep 27, 2021
52c3326
Some cleanup before the next big stage
shankari Sep 27, 2021
a010db8
Add class "col" to the multilabel
shankari Sep 27, 2021
fc10c6c
Pull out the controller code into a separate module
shankari Sep 27, 2021
2624cfb
Convert the trip-confirm-service into a real singleton
shankari Sep 28, 2021
c9621c3
Final cleanup of the main list code
shankari Sep 29, 2021
8a4201d
First step at unifying the diary and label screens
shankari Sep 29, 2021
eb1fd97
Initial version of the "verify check" button linked to the multilabel…
shankari Oct 2, 2021
0f22450
Link the two directives completely and generalizably
shankari Oct 2, 2021
37439dc
Labeling code: infinite scroll list -> directive
shankari Oct 4, 2021
8bc5185
Remove view controller's dependency on one specfic set of filters
shankari Oct 4, 2021
b382b8f
Pull the populate code out into a service
shankari Oct 4, 2021
5074b4e
Address performance issue by pre-populating and removing the directiv…
shankari Oct 4, 2021
354dcd8
First round of unification
shankari Oct 4, 2021
3ec5734
Simplify the invocation of `getUserInputForTrip`
shankari Oct 4, 2021
8a6d4b5
Simplify and unify of the diary and label screens
shankari Oct 4, 2021
a96194d
Second round of unification/cleanup
shankari Oct 4, 2021
a3623e1
patch(SurveyLaunch): startSurveyPrefilled support auto close
atton16 Sep 28, 2021
2b02d7d
Invoke additional methods directly from the DiaryHelper
shankari Oct 5, 2021
9d677bf
Created a more principled directory structure for the surveys
shankari Oct 5, 2021
5ac9e71
Final round of renaming
shankari Oct 5, 2021
3d315a3
Final attempt at generalization for now
shankari Oct 5, 2021
e8f8a0c
Really final set of updates
shankari Oct 5, 2021
2551337
Final cleanup fixes
shankari Oct 5, 2021
19d03cd
Finally get the survey to also be dynamic
shankari Oct 6, 2021
d9cc13b
Copy over the inferred labels to match the code
shankari Oct 6, 2021
4ac493c
Fix the `verifyTrip` code to use `$scope.trip` instead of `trip`
shankari Oct 6, 2021
f3ea875
Refactor the retrieval code for simplicity and performance
shankari Oct 7, 2021
24c4dda
Merge pull request #799 from shankari/refactor_label_code
shankari Oct 14, 2021
5cd55dd
notification open reading
jleyden Feb 26, 2018
78a9369
Fix formatting error from previous commit
shankari Oct 14, 2021
ac9b816
[diary only] Support both imperial and metric units with a config option
shankari Oct 14, 2021
3827130
Allow users to resize the items
shankari Oct 15, 2021
a933410
Remove % height for the leaflet map on android as well
shankari Oct 15, 2021
333dfa3
Merge pull request #800 from shankari/minor_fixes_from_ceo_branch
shankari Oct 15, 2021
75c1357
instrumentation for time spent
jackcsullivan Mar 2, 2018
e244a99
Fix clientstats imports
shankari Oct 16, 2021
5decf90
Support live-reload of the diary screen
shankari Oct 16, 2021
cb98fb1
Fill in new confirmed_trip fields into the unprocessed trips as well
shankari Oct 16, 2021
1634c5f
Fix minor issues with refactoring of retrieval code
shankari Oct 16, 2021
cc465df
Merge pull request #801 from shankari/minor_fixes_from_ceo_branch
shankari Oct 16, 2021
61d8690
Metrics screen should have metrics, not diary stats
shankari Oct 16, 2021
06295b2
Fix name
shankari Oct 16, 2021
d2291ce
Merge pull request #802 from shankari/minor_fixes_from_ceo_branch
shankari Oct 16, 2021
4c8046f
Replace the help/walkthrough button with the resize icon
shankari Oct 18, 2021
b4a4d4a
Merge pull request #803 from shankari/minor_fixes_from_ceo_branch
shankari Oct 18, 2021
6ebeb28
First beta testing version
shankari Oct 18, 2021
ce6bccf
Set the FCM version to 18+
shankari Oct 19, 2021
7eca457
Change the build script to work with aab
shankari Oct 22, 2021
352c2ae
Remove the hardcoded badge plugin
shankari Oct 22, 2021
d124859
Downgrade the ruby version since we don't have a more recent version …
shankari Oct 22, 2021
2025e5e
Upgrade to the updated version of the auth plugin
shankari Oct 24, 2021
29d2d85
Initial version of the status screen (location settings only)
shankari Oct 27, 2021
ec76468
Add status support for the fitness sensors
shankari Oct 28, 2021
7be6cba
Adding in the fitness permission as well
shankari Oct 28, 2021
e9cd270
Enable notification enabled checks
shankari Oct 29, 2021
2b0cf26
Adding support for checking paused notifications
shankari Oct 29, 2021
bfa4bf3
Revert "Adding support for checking paused notifications"
shankari Oct 29, 2021
feca14c
Bump up the java version to 11
shankari Oct 31, 2021
03740df
Fix the code that sets the JAVA_HOME correctly
shankari Oct 31, 2021
fc8d0e2
Add the new unused app restrictions to the status screen
shankari Nov 2, 2021
37e327a
UI changes to handle the "deny" use case correctly
shankari Nov 13, 2021
f3ab75a
Follow on to also update the instructions for the motion activity
shankari Nov 13, 2021
570c87d
Enhance the local notification handling and redirection code
shankari Nov 17, 2021
07dfa93
Allow the user to proceed only when they have made all the settings c…
shankari Nov 17, 2021
539a0fd
Add a new entry to the profile screen which opens the app status modal
shankari Nov 17, 2021
6314932
Pass in parameters to indicate whether we need to launch the app sett…
shankari Nov 17, 2021
ccc5157
Cancel the existing "problematic" notification once the issue is fixed
shankari Nov 17, 2021
5d5692d
Fix some minor formatting and spacing issues
shankari Nov 17, 2021
9e8103d
Add the css classes for the app status code
shankari Nov 17, 2021
4378a70
Add in client side support for additional popup types
shankari Dec 3, 2021
ebec13b
Comment out the redirect to the current screen
shankari Dec 3, 2021
42706f3
Merge pull request #804 from shankari/upgrade_native_2021
shankari Dec 6, 2021
31f9a47
Extract mode labels for user inputs
shankari Dec 11, 2021
cd9c0b1
Change the speed conversion to take mtsPerSec as input
shankari Dec 11, 2021
de8f5e0
Ensure that the summary values are meaningful
shankari Dec 11, 2021
37760b1
Fix graph
shankari Dec 12, 2021
5e4cf73
Replace duplicate copy-pasted code with simple loops
shankari Dec 12, 2021
6e88d8e
Replace duplicate copy-pasted code for the aggregate metrics as well
shankari Dec 12, 2021
5a482f1
Additional refactoring to precompute values
shankari Dec 13, 2021
476206d
Precompute aggregate mode maps as well
shankari Dec 13, 2021
6850bd4
Fix the summary functions and precompute summary values as well
shankari Dec 13, 2021
b7e4446
Pass in the mode maps or summaries to the calorie and carbon footprin…
shankari Dec 13, 2021
dc7da17
Pull out the existing hardcoded mappings into a separate module
shankari Dec 13, 2021
993ad2d
Get the modified calorie calculations to work
shankari Dec 14, 2021
34d55ae
Add initial support for CO2 calculations from custom labels as well
shankari Dec 14, 2021
1a1dcbd
Update the sample with the new fields
shankari Dec 14, 2021
53a2d1e
Change the baseline comparisons from CA to US
shankari Dec 15, 2021
2dd5352
Fix `ic.getMph` to pass the correct parameter
shankari Dec 21, 2021
899ce1d
Turn off optimal and worst until we figure out how to calculate them …
shankari Dec 21, 2021
c0c948c
Improve fit and finish of the dashboard
shankari Dec 22, 2021
052458f
Rename `first` to `defaultTwoWeekUserCall` for greater clarity
shankari Dec 22, 2021
f4a55b2
Fix the button to say "Change dates" instead of "Change data"
shankari Dec 22, 2021
a3518fe
Convert both userCarbon and the goals to numbers
shankari Dec 22, 2021
8616fb0
Fix stupid typo in imperial conversions
shankari Dec 22, 2021
cc40465
Move all the presentation values for the carbon footprint to the HTML
shankari Dec 23, 2021
44baf22
Fix the calorie calculations to be numbers instead of strings as well
shankari Dec 23, 2021
c0aa1c9
Remove unused variables
shankari Dec 23, 2021
dc5d76b
Removed duplicate calls to summarization functions
shankari Dec 23, 2021
3a239e6
Change median_speed to mean_speed
shankari Dec 23, 2021
ddececd
Pre-compute values needed for computation only
shankari Dec 23, 2021
98af95d
Refactor `formatData` to a set of formatters that can be reused
shankari Dec 23, 2021
a8b5f65
Call the formatters directly from the HTML for the numeric summary tab
shankari Dec 23, 2021
d0bdc9a
Minor fixes to the charts
shankari Dec 23, 2021
2c41923
Minor fix to the summary
shankari Dec 23, 2021
41b858f
Finally remove ugly and hacky `getSummaryData`
shankari Dec 23, 2021
a4caeb3
Disable the "filter" option from the date selection
shankari Dec 23, 2021
fc97329
Improve the date range stuff now that we don't have to worry about fi…
shankari Dec 23, 2021
c5eaeb1
Unify the datepicker settings to avoid code duplication
shankari Dec 23, 2021
e311635
Re-enable the "worst" comparison
shankari Dec 24, 2021
dacd3d0
Partially implement the tiered proposal with one "range-limited motor…
shankari Dec 24, 2021
c4df165
Add a note to the metrics clarifying why we are not using the optimal…
shankari Dec 24, 2021
14588e6
Further clarify the text for "worst"
shankari Dec 24, 2021
42e8173
Display a range of values for the carbon footprint
shankari Dec 24, 2021
980bbb4
Change the calorie calculations to also have a range
shankari Dec 25, 2021
cdf4702
Minor formatting fixes to the greater-lesser component
shankari Jan 9, 2022
ef9ae92
Merge pull request #805 from shankari/fix_dashboard_screen
shankari Jan 15, 2022
0064865
Handle the case where no trips have been labeled for two weeks
shankari Jan 15, 2022
e4a74dc
Merge pull request #806 from shankari/fix_dashboard_screen
shankari Jan 15, 2022
14bb822
Handle "other" modes without mappings in the JSON
shankari Jan 20, 2022
f12c54b
Merge pull request #807 from shankari/fix_dashboard_screen
shankari Jan 20, 2022
66b97a9
Add in the "air" mode along with the appropriate CO2 metric
shankari Jan 21, 2022
78f241b
Add "My" to all the headings to be consistent with "My Footprint"
shankari Jan 21, 2022
de4d95f
Switch from `worst` to `CO2 saved vs worst"
shankari Jan 21, 2022
2ccbe6a
Add a meaningful equivalent of the carbon saved
shankari Jan 21, 2022
f953a3e
Make sure to flip the high and low for carbon avoided
shankari Jan 21, 2022
d2ec7f1
Merge pull request #808 from shankari/fix_dashboard_screen
shankari Jan 21, 2022
3050a3a
Bump up the version numbers of the data collection and server sync pl…
shankari Jan 28, 2022
544a679
Merge pull request #809 from shankari/support_new_plugins
shankari Jan 28, 2022
127c580
Internationalize the sensor headings as well
shankari Feb 5, 2022
d2742b2
Change text some more
shankari Feb 5, 2022
3646511
Ensure that the location notifications are delivered only after regis…
shankari Feb 8, 2022
6abb703
Merge pull request #810 from shankari/finish_status_screen
shankari Feb 8, 2022
44f0a4a
Refresh the status checks before the status modal is opened
shankari Feb 9, 2022
78fc6ea
Ensure that the mph values are also formatted
shankari Feb 9, 2022
521c458
Merge pull request #811 from shankari/finish_status_screen
shankari Feb 9, 2022
d69f3a5
Create the iOS version of the status screen
shankari Feb 10, 2022
8d8210a
Ensure that the phone app headers are large enough
shankari Feb 23, 2022
30c3173
Add instructions on enabling cleartext traffic
shankari Feb 23, 2022
353b283
Internationalize all the text
shankari Feb 23, 2022
b12de61
Ensure that we refresh the status when the app resumes
shankari Feb 23, 2022
5980715
Bump up version numbers to reflect the new changes
shankari Feb 23, 2022
fbb30e9
Merge pull request #812 from shankari/finish_status_screen
shankari Feb 23, 2022
5c47864
Update build badges
shankari Feb 24, 2022
a52244a
Address minor fit and finish fixes
shankari Feb 25, 2022
4f390af
Don't display the differences if it is not a two week call
shankari Feb 25, 2022
99a8c1c
Ensure that the twoWeeksAgo flag is set consistently
shankari Feb 25, 2022
d9c340e
Humanize the dashboard values better
shankari Feb 26, 2022
0dd0ebd
Only display the worst carbon and the aggregate carbon once they exist
shankari Feb 26, 2022
49f0fe5
Bump up the amount by which we increase the itemHeight
shankari Feb 26, 2022
14afcdd
Reconcile prior changes to the twoWeeksAgo flag
shankari Mar 1, 2022
6f59cc6
Fix the instructions for turning off the "force https" requirement on…
shankari Mar 23, 2022
351edfc
Bump up the version numbers to support the fix for the unused app res…
shankari Mar 23, 2022
903c0d3
Merge pull request #813 from shankari/minor_fit_and_finish
shankari Mar 23, 2022
82a2e53
Remove most of the devDependencies from leaflet
shankari Mar 23, 2022
3a49df0
Merge pull request #814 from shankari/minor_fit_and_finish
shankari Mar 24, 2022
bf96df3
Fix "second level of end checks" for the user label matching
shankari Mar 28, 2022
69683e1
Merge pull request #815 from shankari/minor_fit_and_finish
shankari Mar 28, 2022
5065c80
Update the documentation to remove dependency on android studio
shankari Mar 30, 2022
4f16827
Add some additional log statements
shankari Mar 30, 2022
70fdf38
Automate the installation of the prerequistes
shankari Mar 30, 2022
00cac15
Check the automated SDK install process
shankari Mar 30, 2022
58ed766
Change the SDK install to trigger the workflow
shankari Mar 30, 2022
9179850
Merge pull request #816 from shankari/minor_fit_and_finish
shankari Apr 3, 2022
2423030
Get the installation checks to actually work (#817)
shankari Apr 4, 2022
61777e2
Merge pull request #818 from e-mission/test_sdk_install
shankari Apr 4, 2022
cf72cc9
Update packages and bump up version numbers
shankari Apr 8, 2022
58b6c04
Merge pull request #819 from shankari/fix_crash_on_launch
shankari Apr 8, 2022
16876d0
Upgrade leaflet to the most recent 1.8.0
shankari Apr 25, 2022
93a0bde
Ensure that the map is displayed correctly
shankari Apr 25, 2022
7191bc6
Override the large margin
shankari Apr 25, 2022
a20fcce
Remove the quotes around the height in pixels
shankari Apr 26, 2022
5b89322
Ensure that the map id is actually unique
shankari Apr 26, 2022
6e0b807
Merge pull request #820 from shankari/fix_maps
shankari Apr 26, 2022
d36ef98
Support the "notch" properly on iOS
shankari Apr 26, 2022
a8a3353
Bump up version numbers for plugins
shankari Apr 27, 2022
ec2a4fe
Turn on loading while making remote calls from the infinite scroll sc…
shankari Apr 27, 2022
c4e5972
Merge pull request #821 from shankari/fix_maps
shankari Apr 27, 2022
0f2f5de
Add additional logging + one more overlay hide
shankari Apr 27, 2022
f13ca57
Merge pull request #822 from shankari/fix_maps
shankari Apr 27, 2022
679acd6
Fix the weird issue where the map popup breaks maps in the diary list
shankari Apr 29, 2022
7d98d5d
Add the labels to the detail screen
shankari Apr 30, 2022
0eb72b1
Add the labels to the diary detail screen as well
shankari Apr 30, 2022
a238421
Ensure that we show the detail date on the detail screen header
shankari Apr 30, 2022
bddce88
Support a reconfigurable recompute delay instead of the hardcoded 30 …
shankari Apr 30, 2022
ba1fa7a
Automatically close the detail screen once we have the labels
shankari Apr 30, 2022
6b85be3
Comment out the labels in the detail screen
shankari Apr 30, 2022
2b72468
Hack to fix the grayed out map issues for once and for all
shankari May 1, 2022
317e297
Fix the "recompute delay" check
shankari May 1, 2022
85a94ff
Re-enable the in-detail labels
shankari May 1, 2022
c302d65
Ensure that labels set in the diary screen are reflected in the label…
shankari May 2, 2022
761eed4
Bump up the version numbers to address the new map fixes
shankari May 2, 2022
dd64e8a
Merge pull request #823 from shankari/fix_maps
shankari May 2, 2022
84e0e9e
Merge pull request #824 from shankari/fix_maps
shankari May 2, 2022
fe9bedd
Merge branch 'master' of https://github.com/e-mission/e-mission-phone…
shankari May 6, 2022
26a015f
Fixes to populateManualInputs from testing
shankari May 6, 2022
b328159
Comment out the dashboard screen
shankari May 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/android-automated-sdk-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: osx-install-android-sdk-automated

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
paths:
- 'setup/prereq_android_sdk_install.sh'
pull_request:
paths:
- 'setup/prereq_android_sdk_install.sh'
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '5 4 * * 0'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
install:
# The type of runner that the job will run on
runs-on: macos-latest

env:
NEW_ANDROID_SDK_ROOT: /tmp/new-install/Android/sdk

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Print the current SDK root and version
run: |
echo "SDK root before install $ANDROID_SDK_ROOT"
cat $ANDROID_SDK_ROOT/cmdline-tools/latest/source.properties
echo "Existing installed packages"
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --list_installed

- name: Install to a new SDK root
run: |
export ANDROID_SDK_ROOT=$NEW_ANDROID_SDK_ROOT
echo "New SDK root $ANDROID_SDK_ROOT"
printf "Y\nY\nY\nY\nY\n" | bash setup/prereq_android_sdk_install.sh

- name: Verify that all packages are as expected
shell: bash -l {0}
run: |
echo "Comparing $ANDROID_SDK_ROOT and $NEW_ANDROID_SDK_ROOT"
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --list_installed > /tmp/existing_packages
$NEW_ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --list_installed > /tmp/new_packages
diff -uw /tmp/existing_packages /tmp/new_packages
echo "Expected differences; emulators, SDK versions, tool versions"

- name: Verify that directory structure is consistent
shell: bash -l -x {0}
run: |
export ANDROID_SDK_ROOT=$NEW_ANDROID_SDK_ROOT
echo "New SDK root $ANDROID_SDK_ROOT"
ls -al $ANDROID_SDK_ROOT
if [ ! -d $ANDROID_SDK_ROOT/emulator ]; then exit 1; fi
if [ ! -d $ANDROID_SDK_ROOT/build-tools ]; then exit 1; fi
if [ ! -d $ANDROID_SDK_ROOT/patcher ]; then exit 1; fi
if [ ! -d $ANDROID_SDK_ROOT/extras ]; then exit 1; fi
if [ ! -d $ANDROID_SDK_ROOT/platforms ]; then exit 1; fi
if [ ! -d $ANDROID_SDK_ROOT/platform-tools ]; then exit 1; fi
if [ ! -d $ANDROID_SDK_ROOT/system-images ]; then exit 1; fi

- name: Ensure that the path is correct and installed programs are runnable
shell: bash -l {0}
run: |
export JAVA_HOME=$JAVA_HOME_11_X64
export ANDROID_SDK_ROOT=$NEW_ANDROID_SDK_ROOT
echo "New SDK root $ANDROID_SDK_ROOT"
$ANDROID_SDK_ROOT/emulator/emulator -list-avds

- name: Ensure that the path is correct and the project can be activated
shell: bash -l {0}
run: |
export JAVA_HOME=$JAVA_HOME_11_X64
export ANDROID_SDK_ROOT=$NEW_ANDROID_SDK_ROOT
echo "New SDK root $ANDROID_SDK_ROOT"
source setup/activate_native.sh
17 changes: 14 additions & 3 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,32 @@ jobs:
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Print the java version
run: java -version
- name: Print the java and gradle versions
run: |
echo "Default java version"
java -version
echo "Setting to Java 11 instead"
export JAVA_HOME=$JAVA_HOME_11_X64
java -version
echo "Checking gradle"
which gradle
gradle -version

- name: Tries to figure out where android is installed
run: |
echo "Android listed at $ANDROID_HOME"
echo "Android listed at $ANDROID_SDK_ROOT"
ls -al /opt/

- name: Setup the cordova environment
shell: bash -l {0}
run: |
export JAVA_HOME=$JAVA_HOME_11_X64
bash setup/setup_android_native.sh

- name: Check tool versions
shell: bash -l {0}
run: |
export JAVA_HOME=$JAVA_HOME_11_X64
source setup/activate_native.sh
echo "cordova version"
npx cordova -version
Expand All @@ -59,6 +69,7 @@ jobs:
gradle -version
echo "Let's rerun the activation"
source setup/activate_native.sh
export JAVA_HOME=$JAVA_HOME_11_X64
echo $PATH
which gradle
gradle --version
Expand Down
44 changes: 37 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ One advantage of using `skip` authentication in development mode is that any use

Updating the e-mission-\* plugins or adding new plugins
---
[![osx-build-ios](https://github.com/e-mission/e-mission-phone/workflows/osx-build-ios/badge.svg)](https://github.com/e-mission/e-mission-phone/actions?query=workflow%3Aosx-ubuntu-build-android)
[![osx-ubuntu-build-android](https://github.com/e-mission/e-mission-phone/workflows/osx-ubuntu-build-android/badge.svg)](https://github.com/e-mission/e-mission-phone/actions?query=workflow%3Aosx-build-ios)
[![osx-build-ios](https://github.com/e-mission/e-mission-phone/actions/workflows/ios-build.yml/badge.svg)](https://github.com/e-mission/e-mission-phone/actions/workflows/ios-build.yml)
[![osx-build-android](https://github.com/e-mission/e-mission-phone/actions/workflows/android-build.yml/badge.svg)](https://github.com/e-mission/e-mission-phone/actions/workflows/android-build.yml)

Pre-requisites
---
Expand All @@ -94,10 +94,32 @@ Pre-requisites
- or this [supposedly easier to use repo](https://github.com/xcpretty/xcode-install)
- **NOTE**: the basic xcode install on Catalina was messed up for me due to a prior installation of command line tools. [These workarounds helped](https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md).
- git
- the most recent version of android studio
- **NOTE**: although Catalina has a `/usr/bin/java`, trying to run it gives the error `No Java runtime present, requesting install.`. Installed [OpenJDK 1.8 using AdoptOpenJDK](https://adoptopenjdk.net/releases.html) to be consistent with the CI.
- NOTE: The setup script below will modify this install to workaround
https://github.com/actions/virtual-environments/issues/3757
- Java 11. Tested with [OpenJDK 11 (Temurin) using AdoptOpenJDK](https://adoptopenjdk.net/releases.html).
- 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
```

<details><summary>Expected output</summary>

```
Downloading the command line tools for mac
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 114M 100 114M 0 0 8092k 0 0:00:14 0:00:14 --:--:-- 8491k
Found downloaded file at /tmp/commandlinetools-mac-8092744_latest.zip
Installing the command line tools
Archive: /tmp/commandlinetools-mac-8092744_latest.zip
...
Downloading the android SDK. This will take a LONG time and will require you to agree to lots of licenses.
Do you wish to continue? (Y/N)Y
...
Accept? (y/N): Y
...
[====== ] 17% Downloading x86_64-23_r33.zip... s
```

</details>

Important
---
Expand Down Expand Up @@ -136,9 +158,17 @@ $ cp ..... www/json/connectionConfig.json
$ source setup/activate_native.sh
```

### Activation (after install, and in every new shell)

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>
```

Run in the emulator
### Run in the emulator

```
$ npx cordova emulate ios
Expand Down
7 changes: 4 additions & 3 deletions bin/sign_and_align_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fi
# Sign and release the L+ version
# Make sure the highest supported version has the biggest version code
npx cordova build android --release -- --minSdkVersion=22
cp platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk platforms/android/app/build/outputs/apk/app-release-signed-unaligned.apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../config_files/production.keystore ./platforms/android/app/build/outputs/apk/app-release-signed-unaligned.apk androidproductionkey
~/Library/Android/sdk/build-tools/30.0.1/zipalign -v 4 platforms/android/app/build/outputs/apk/app-release-signed-unaligned.apk $1-build-$2.apk
# cp platforms/android/app/build/outputs/apk/release/app-release-unsigned.aab platforms/android/app/build/outputs/apk/app-release-signed-unaligned.apk
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore ../config_files/production.keystore ./platforms/android/app/build/outputs/bundle/release/app-release.aab androidproductionkey
cp platforms/android/app/build/outputs/bundle/release/app-release.aab $1-build-$2.aab
# ~/Library/Android/sdk/build-tools/30.0.1/zipalign -v 4 platforms/android/app/build/outputs/apk/app-release-signed-unaligned.apk $1-build-$2.apk
4 changes: 2 additions & 2 deletions config.cordovabuild.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="41" id="edu.berkeley.eecs.emission" ios-CFBundleVersion="41" version="3.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="46" id="edu.berkeley.eecs.emission" ios-CFBundleVersion="44" version="3.2.3" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>emission</name>
<description>
A commute pattern tracker and carbon footprint estimator.
Expand Down Expand Up @@ -46,7 +46,7 @@
<platform name="android">
<hook src="hooks/before_build/android/android_copy_locales.js" type="before_build" />
<preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="29" />
<preference name="android-targetSdkVersion" value="30" />
<preference name="AndroidXEnabled" value="true" />
<resource-file src="google-services.json" target="app/google-services.json" />
<hook src="hooks/before_build/android/android_set_provider.js" type="before_build" />
Expand Down
62 changes: 34 additions & 28 deletions package.cordovabuild.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edu.berkeley.eecs.emission",
"version": "3.0.0",
"version": "3.2.3",
"displayName": "emission",
"license": "BSD-3-Clause",
"repository": {
Expand All @@ -18,22 +18,27 @@
"ios"
],
"plugins": {
"phonegap-plugin-push": {
"FCM_VERSION": "17.0.0"
"@havesource/cordova-plugin-push": {
"ANDROID_SUPPORT_V13_VERSION": "28.0.0",
"FCM_VERSION": "18.+",
"IOS_FIREBASE_MESSAGING_VERSION": "~> 6.32.2"
},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-app-version": {},
"cordova-plugin-file": {},
"cordova-plugin-device": {},
"cordova-plugin-customurlscheme": {
"URL_SCHEME": "emission"
"URL_SCHEME": "emission",
"ANDROID_SCHEME": " ",
"ANDROID_HOST": " ",
"ANDROID_PATHPREFIX": "/"
},
"cordova-plugin-email-composer": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-x-socialsharing": {
"PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."
"PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to share photos on social media.",
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to share photos on social media."
},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-local-notification": {},
Expand All @@ -48,49 +53,50 @@
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-whitelist": {},
"cordova-plugin-em-jwt-auth": {
"AUTH_VERSION": "17.0.0"
"AUTH_VERSION": "19.2.0"
},
"cordova-plugin-em-server-communication": {},
"cordova-plugin-em-datacollection": {
"LOCATION_VERSION": "17.0.0"
"LOCATION_VERSION": "18.0.0",
"ANDROIDX_CORE_VERSION": "1.7.0"
},
"cordova-plugin-em-serversync": {},
"cordova-plugin-em-settings": {},
"cordova-plugin-em-transition-notify": {},
"cordova-plugin-em-unifiedlogger": {},
"cordova-plugin-em-usercache": {},
"cordova-plugin-androidx-adapter": {}
"cordova-plugin-androidx-adapter": {},
"phonegap-plugin-barcodescanner": {}
}
},
"dependencies": {
"cordova-android": "9.0.0",
"cordova-ios": "6.1.0",
"cordova-plugin-advanced-http": "3.0.0",
"cordova-android": "10.1.0",
"cordova-ios": "6.2.0",
"cordova-plugin-advanced-http": "3.2.2",
"cordova-plugin-androidx-adapter": "git+https://github.com/dpa99c/cordova-plugin-androidx-adapter.git",
"cordova-plugin-app-version": "0.1.9",
"cordova-plugin-customurlscheme": "5.0.1",
"cordova-plugin-device": "2.0.1",
"cordova-plugin-em-datacollection": "git+https://github.com/e-mission/e-mission-data-collection.git#v1.6.0",
"cordova-plugin-em-jwt-auth": "git+https://github.com/e-mission/cordova-jwt-auth.git#v1.6.4",
"cordova-plugin-app-version": "0.1.12",
"cordova-plugin-customurlscheme": "5.0.2",
"cordova-plugin-device": "2.0.3",
"cordova-plugin-em-datacollection": "git+https://github.com/e-mission/e-mission-data-collection.git#v1.7.2",
"cordova-plugin-em-jwt-auth": "git+https://github.com/e-mission/cordova-jwt-auth.git#v1.6.5",
"cordova-plugin-em-server-communication": "git+https://github.com/e-mission/cordova-server-communication.git#v1.2.3",
"cordova-plugin-em-serversync": "git+https://github.com/e-mission/cordova-server-sync.git#v1.2.5",
"cordova-plugin-em-serversync": "git+https://github.com/e-mission/cordova-server-sync.git#v1.2.8",
"cordova-plugin-em-settings": "git+https://github.com/e-mission/cordova-connection-settings.git#v1.2.2",
"cordova-plugin-em-transition-notify": "git+https://github.com/e-mission/e-mission-transition-notify.git#v1.2.6",
"cordova-plugin-em-unifiedlogger": "git+https://github.com/e-mission/cordova-unified-logger.git#v1.3.3",
"cordova-plugin-em-usercache": "git+https://github.com/e-mission/cordova-usercache.git#v1.1.3",
"cordova-plugin-em-transition-notify": "git+https://github.com/e-mission/e-mission-transition-notify.git#v1.2.7",
"cordova-plugin-em-unifiedlogger": "git+https://github.com/e-mission/cordova-unified-logger.git#v1.3.5",
"cordova-plugin-em-usercache": "git+https://github.com/e-mission/cordova-usercache.git#v1.1.5",
"cordova-plugin-email-composer": "0.9.2",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-inappbrowser": "4.0.0",
"cordova-plugin-ionic": "5.4.7",
"cordova-plugin-inappbrowser": "5.0.0",
"cordova-plugin-ionic": "5.5.1",
"cordova-plugin-ionic-keyboard": "2.2.0",
"cordova-plugin-ionic-webview": "5.0.0",
"cordova-plugin-local-notification": "0.9.0-beta.3",
"cordova-plugin-whitelist": "~1.3.3",
"cordova-plugin-x-socialsharing": "6.0.0",
"cordova-plugin-local-notification": "https://github.com/timkellypa/cordova-plugin-local-notifications.git#083ccca0f4eee8fbec0cde1edd32207c286d2a04",
"cordova-plugin-x-socialsharing": "6.0.3",
"fs-extra": "^9.0.1",
"klaw-sync": "^6.0.0",
"phonegap-plugin-push": "=2.3.0"
"phonegap-plugin-barcodescanner": "git+https://github.com/phonegap/phonegap-plugin-barcodescanner#v8.1.0",
"@havesource/cordova-plugin-push": "2.0.0"
}
}
3 changes: 3 additions & 0 deletions setup/activate_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ fi
echo "Activating sdkman, and by default, gradle"
source ~/.sdkman/bin/sdkman-init.sh

echo "Ensuring that we use the most recent version of the command line tools"
export PATH=$ANDROID_SDK_ROOT/sdk/cmdline-tools/bin:$ANDROID_SDK_ROOT/emulator:$PATH

echo "Configuring the repo for building native code"
./bin/configure_xml_and_json.js cordovabuild
22 changes: 22 additions & 0 deletions setup/android_sdk_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
build-tools;30.0.1
build-tools;30.0.2
build-tools;30.0.3
build-tools;31.0.0
emulator
extras;google;google_play_services
extras;intel;Hardware_Accelerated_Execution_Manager
patcher;v4
platform-tools
platforms;android-30
platforms;android-31
system-images;android-22;google_apis;x86_64
system-images;android-23;google_apis;x86_64
system-images;android-24;google_apis_playstore;x86
system-images;android-25;google_apis_playstore;x86
system-images;android-26;google_apis_playstore;x86
system-images;android-27;google_apis_playstore;x86
system-images;android-28;google_apis_playstore;x86_64
system-images;android-29;google_apis_playstore;x86
system-images;android-29;google_apis_playstore;x86_64
system-images;android-30;google_apis_playstore;x86
system-images;android-30;google_apis_playstore;x86_64
10 changes: 5 additions & 5 deletions setup/export_shared_dep_versions.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export NVM_VERSION=0.36.0
export NODE_VERSION=14.7.0
export NPM_VERSION=6.14.8
export NVM_VERSION=0.39.0
export NODE_VERSION=14.18.1
export NPM_VERSION=6.14.15
export RUBY_VERSION=2.6.0
export COCOAPODS_VERSION=1.10.0
export GRADLE_VERSION=6.7
export COCOAPODS_VERSION=1.11.2
export GRADLE_VERSION=7.1.1

export NVM_DIR="$HOME/.nvm"
export RUBY_PATH=$HOME/.gem/ruby/$RUBY_VERSION/bin
Loading