Skip to content

Conversation

@ynnadkrap
Copy link
Contributor

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

ynnadkrap added 7 commits July 1, 2015 21:57
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.
@ynnadkrap ynnadkrap changed the title Danny feat hospital tracker Hospitalization Jul 29, 2015

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

@alexperto
Copy link

@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.
@rbarrera87
Copy link
Member

@ynnadkrap do you know why am I getting this error?

09-22 15:54:14.477  26560-26613/org.healtheheartstudy W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0x9f526720, error=EGL_SUCCESS

@ynnadkrap
Copy link
Contributor Author

When are you getting the error?

On Tue, Sep 22, 2015 at 3:07 PM, Richard notifications@github.com wrote:

@ynnadkrap https://github.com/ynnadkrap do you know why am I getting
this error?

09-22 15:54:14.477 26560-26613/org.healtheheartstudy W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0x9f526720, error=EGL_SUCCESS


Reply to this email directly or view it on GitHub
#2 (comment).

@rbarrera87
Copy link
Member

When I click in the "Display Dummy Survey" button

screen shot 2015-09-22 at 1 11 44 pm

Copy link
Member

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;

@ynnadkrap
Copy link
Contributor Author

That's strange. I've never seen that error before. Can you tell me more
about the device you're using? Is it an emulator? Genymotion or android
studio emulator? Real device?

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:

When I click in the "Display Dummy Survey"

[image: screen shot 2015-09-22 at 1 11 44 pm]
https://cloud.githubusercontent.com/assets/141734/10030229/81dce16a-612b-11e5-85f9-2335a4dbc871.png


Reply to this email directly or view it on GitHub
#2 (comment).

@rbarrera87
Copy link
Member

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.

@ynnadkrap
Copy link
Contributor Author

There should be a dialog that pops up.

On Tue, Sep 22, 2015 at 3:29 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.


Reply to this email directly or view it on GitHub
#2 (comment).

@rbarrera87
Copy link
Member

Crap... then yeah I need to fix that...

@rbarrera87
Copy link
Member

No... my bad... I get the pop up

screen shot 2015-09-22 at 1 47 59 pm

But when I click Yes nothing happens

@ynnadkrap
Copy link
Contributor Author

Cool. The buttons don't trigger anything yet so don't worry about that.
On Sep 22, 2015 3:48 PM, "Richard" notifications@github.com wrote:

No... my bad... I get the pop up

[image: screen shot 2015-09-22 at 1 47 59 pm]
https://cloud.githubusercontent.com/assets/141734/10031178/99bcd13c-6130-11e5-9d2b-891d53c18eb0.png

But when I click Yes nothing happens


Reply to this email directly or view it on GitHub
#2 (comment).

@rbarrera87
Copy link
Member

Awesome! Thanks @ynnadkrap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants