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

Fix #875 - Implement user opt-in travel behavior data collection #988

Merged
merged 20 commits into from
Jul 9, 2019

Conversation

cagryInside
Copy link
Contributor

@cagryInside cagryInside commented Jun 22, 2019

This PR implements an opt-in user-travel-behavior tracking feature to OBA. With this PR, after the user agrees to participate the application will collect the users' travel behaviors and push the results to a Firebase Firestore.

The following screens are for registering participating users:

Screen 1 Screen 2 Screen 3 Screen 4
device-2019-07-02-103554 device-2019-07-02-103615 device-2019-07-02-103643 device-2019-07-02-103709

Once the user saves his/her email address, OBA starts collecting the following data:

  • activity transitions
  • arrivals and departures
  • trip plans
  • device information

The following screenshots show the collected data:

Activity Transition Data Detected Activity Location
Screen Shot 2019-06-21 at 6 15 28 PM Screen Shot 2019-06-21 at 6 14 30 PM Screen Shot 2019-06-21 at 6 14 42 PM

TODO:

  • Participant registration flow error handling:
    • Finalize the design of the views
    • Disable pressing back button and outside of the dialog while registering
    • Handle error messages while saving the email address
    • Show loading dialog while saving the email address
    • Validate email address
  • Implement Destination reminders
  • Implement Permissions requests
  • Implement a global switch to OBA regions API
    • Implement the Android side
    • Implement the server side
  • Implement an opt-out option in settings
  • Do not initialize the Transition API when every time the app starts (see the comment be1a67a#diff-8dc92f32bc698f47c67820a05841eca9R216)
  • Put the final URLs & google-services.json for Firebase and Google Drive
    • Implement the access control policy to both: OBA write-only
  • Remove enumeration of the record ids ( the current enumeration is used for debugging purposes) We're going to leave this for troubleshooting

@barbeau barbeau added this to the v2.5.x milestone Jun 24, 2019
// then do not create a new object
// However, every time the above method is called, the application stops receiving
// activity transitions
// TODO: figure out the problem described above
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just flagging TODO statement here

@cagryInside cagryInside force-pushed the issue875TravelBehavior branch from be1a67a to a31ae6f Compare June 25, 2019 05:36
@cagryInside
Copy link
Contributor Author

@barbeau Implemented the destination reminder feature. It looks like this on Firebase:
Screen Shot 2019-06-24 at 10 32 43 PM

@barbeau
Copy link
Member

barbeau commented Jun 25, 2019

@cagryInside Destination reminder data looks good, although we do need to add regionId as well. We also shouldn't apply the 30 minute cache threshold to the destination reminder data - all destination reminder data should be saved to Firestore for enrolled participants.

@cagryInside cagryInside force-pushed the issue875TravelBehavior branch from a31ae6f to edf4e7b Compare June 26, 2019 19:13
@cagryInside
Copy link
Contributor Author

@barbeau I implemented a global switch in the OBARegions api. Also, add a switch on preferences:
device-2019-06-26-122222

@cagryInside cagryInside force-pushed the issue875TravelBehavior branch from edf4e7b to a3b8b42 Compare June 27, 2019 00:57
barbeau added a commit to OneBusAway/onebusaway-multiregion-support that referenced this pull request Jun 27, 2019
@cagryInside cagryInside force-pushed the issue875TravelBehavior branch 2 times, most recently from 9b300d5 to 74ada98 Compare July 1, 2019 18:26
@cagryInside
Copy link
Contributor Author

@barbeau Implemented device information feature as we discussed. The data look like this on Firebase:

Screen Shot 2019-07-02 at 8 00 41 PM

… collection feature

Fix OneBusAway#990 - Interpret alert end time of 0 as unending alert

Fix OneBusAway#976 Resolve Guava version conflicts in Embedded Social

Fix OneBusAway#943 Workaround for String.isEmpty() being broken in newer versions of Gradle

WIP Fix OneBusAway#875 - User-travel-behavior - Implement ignore battery optimizations feature

User-travel-behavior - Implement storing device information
@barbeau barbeau force-pushed the issue875TravelBehavior branch from 3add9e8 to 16c0cac Compare July 3, 2019 13:57
Also code cleanup
@barbeau
Copy link
Member

barbeau commented Jul 3, 2019

@cagryInside Something seems to have broken initial application installation and startup in the latest set of changes. If I do a fresh install and grant the location permission, nothing happens - I just stare at the world map. If I kill the app and restart it, then the normal startup process continues. So it looks like something is happening with the initial location callback and region selection task.

FYI, I changed to only prompt for battery optimizations if the user is enrolled in the study in 724d33e. However, I commented out HomeActivity.checkBatteryOptimizations() entirely and then did a fresh install and got the same behavior as above (and when I removed my change), so it appears unrelated.

@barbeau
Copy link
Member

barbeau commented Jul 3, 2019

@cagryInside Also - could you please add an "OK" dialog with some text if the user says they are under 18 when enrolling? Something like "Thanks for your interest, but you need to be over the age of 18 to participate".

@barbeau
Copy link
Member

barbeau commented Jul 8, 2019

To document @cagryInside and I's offline discussion - we've implemented a feature to allow the user to ignore battery optimziations, but we've commented it out in this PR (including commenting out the permission in the manifest) because it doesn't seem to be needed now, and it could have negative consequences on battery life.

We also haven't solved the "Do not initialize the Transition API when every time the app starts (see the comment be1a67a#diff-8dc92f32bc698f47c67820a05841eca9R216)" issue, but we're going to go ahead and merge this for now while we continue to try and solve the problem.

@barbeau
Copy link
Member

barbeau commented Jul 8, 2019

USF IRB declared this study exempt so we don't need to include the full IRB informed consent document. I'm going to edit it down in one of the final commits here so we have a record of it in this PR if we change the survey design and need to add it back later after further review.

EDIT - Upon further clarification from IRB, we don't need to include the full informed consent, but do need to include text that addresses the following:

Per AAHRPP standards, even though this study has been determined to be exempt, please ensure the following information is disclosed to participants during consenting procedures. This can be done through your current informed consent document for the study, or another type of document or verbal script that you create:

  1. That the activity involves research;
  2. A description of the procedures;
  3. That participation is voluntary;
  4. Name and contact information for the Researcher; and
  5. There are adequate provisions to maintain the privacy interests of participants.

@cagryInside
Copy link
Contributor Author

@barbeau Implemented the Talkback-enabled feature:

Screen Shot 2019-07-08 at 9 20 40 PM

@barbeau
Copy link
Member

barbeau commented Jul 9, 2019

Thanks @cagryInside!

@barbeau barbeau changed the title WIP Fix #875 - User-travel-behavior tracking data collection implementation Fix #875 - Implement user opt-in travel behavior data collection Jul 9, 2019
@barbeau barbeau modified the milestones: v2.5.x, v2.6 Jul 9, 2019
@barbeau barbeau merged commit 11e81df into OneBusAway:master Jul 9, 2019
@barbeau barbeau modified the milestones: v2.7, v2.6 Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants