-
Notifications
You must be signed in to change notification settings - Fork 0
Hospitalization #2
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
base: master
Are you sure you want to change the base?
Conversation
Geofences will be removed after they're triggered by sending a broadcast to HospitalTrackingService from the receiving IntentService. A 24-hour timer is setup after geofences are created to refresh the geofences. This is to account for any drastic location changes (i.e. user flew to a different city overnight), and to reintroduce any triggered geofences that were removed. The reboot receiver is triggered when the system reboots. It restarts the tracking service because the geofences are cleared when the system shuts down.
Instead of having an eternal service, shut down the service after performing its task. IntentService was not an appropriate option for this because there are many callbacks that need to be waited on. Additionally, an Alarm is set when the user first opens the app or when the device reboots. When the alarm triggers, it will call the service to re-create geofences.
Users must DWELL in a hospital for 4 hours to qualify as being hospitalized. If the 4 hour requirement is met, the user will be presented with a survey 1-hour after leaving the hospital. All data stored in SharedPreferences is now encrypted. A daily alarm will be scheduled to make sure the registered geofences are within the user's location. If the user has traveled a significant distance, we'll retrieve a new set of hospitals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we'll need these variables someone else, why don't to move them to Constants
|
@ynnadkrap, I'm not an Android expert but your code looks great, nice job! |
Move timer and geofence constant values to Constants.java Create geofences after receiving a status callback from removing geofences
Change survey design to allow for stacked buttons and change language. Add a function in HospitalizationService to add custom hospitals.
Update SDK and support versions to 23.
|
@ynnadkrap do you know why am I getting this error? |
|
When are you getting the error? On Tue, Sep 22, 2015 at 3:07 PM, Richard notifications@github.com wrote:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it better to set the value instead the operation?
public static final long ONE_HOUR_MILLIS = 3600000;
...
public static final int GEOFENCE_LOITER_TIME_MILLIS = 14400000;|
That's strange. I've never seen that error before. Can you tell me more Have you tried this solution? http://stackoverflow.com/questions/28966496/android-studio-emulator-eglsurfaceattrib-not-implemented On Tue, Sep 22, 2015 at 3:12 PM, Richard notifications@github.com wrote:
|
|
I am using Genymotion, I'm checking that link and it says that it's only a warning, however should I see something after I click that button? cause if that is only a warning then it doesn't make any sense to get into it. |
|
There should be a dialog that pops up. On Tue, Sep 22, 2015 at 3:29 PM, Richard notifications@github.com wrote:
|
|
Crap... then yeah I need to fix that... |
|
Cool. The buttons don't trigger anything yet so don't worry about that.
|
|
Awesome! Thanks @ynnadkrap |


If testing, you probably want to change some time values:
GeofenceClient.java
GEOFENCE_LOITER_TIME_MILLIS // Hospitalization time requirement
AlarmHelper.java
ONE_HOUR // Time to wait before sending survey to user after user EXITs hospital
ONE_DAY // Time interval for checking if we need to update hospitals to reflect any location changes