Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
d1d815f
Merge pull request #1 from EMSTrack/refactor
mcdeoliveira Feb 14, 2018
c578d2e
More clean up...
Feb 15, 2018
814a910
Refactoring hospital into ambulance.
mcdeoliveira Feb 21, 2018
de790d9
Adding activities into CleanApp.
mcdeoliveira Feb 21, 2018
80eda3a
adding activities to CleanApp
jesskwok Feb 22, 2018
281e9e4
Basic GPS logging
blanco7258 Feb 22, 2018
42d418c
Merge remote-tracking branch 'remotes/origin/devel' into jessDev
jesskwok Feb 22, 2018
34e20ae
Added GPSTracker and request for location permissions
blanco7258 Feb 22, 2018
d1d5d1d
Consolidation after merging with new ui.
Feb 22, 2018
1bcd95a
Adding gps module.
Feb 22, 2018
4024a4a
Gps module.
mcdeoliveira Feb 23, 2018
b061ed7
Usable updated version of gps service.
Feb 23, 2018
7565215
Merge branch 'master' into jessDev
Feb 23, 2018
8a0ad7f
Removing gps module
Feb 23, 2018
b286bdc
Changed to proper name: activity to fragment
tnguyen7 Feb 27, 2018
35562e3
Make keyboard disappear on screen click
velin13 Feb 27, 2018
35a50da
fix color palette on ambulance selection page
velin13 Feb 27, 2018
1ca5d9c
make hamburger menu visible
velin13 Feb 27, 2018
8589c32
Change button into imageButton so that it is to scale
velin13 Feb 27, 2018
b5d2199
GPSFragment connected to GPSTracker
tnguyen7 Feb 27, 2018
0151cea
Spanish version strings.xml made
velin13 Feb 27, 2018
064e9b1
Got the UI working for the Hospital tab.
jesskwok Mar 1, 2018
832ec90
Resolved conflicts
jesskwok Mar 1, 2018
ec4046a
resolved conflicts for Hospital tab UI updates
jesskwok Mar 1, 2018
bdd18be
Modifying Ambulance and Location in order to allow for partial serial…
Mar 1, 2018
f348da3
Storing ambulance in MainActivity and preparing to receive future upd…
Mar 1, 2018
ca1a81d
Updating ambulance after gps update.
Mar 1, 2018
e4c5b0c
Location Updated to Server through MQTT
yblank1 Mar 6, 2018
f181c5b
Add floating action button for navigation button
velin13 Mar 6, 2018
af1e9cd
Merge pull request #1 from EMSTrack/UIUpdatesBeforeMerg
mcdeoliveira Mar 8, 2018
c68fc50
Added google map preview
tnguyen7 Mar 8, 2018
89507ca
Merge remote-tracking branch 'remotes/origin/Feb28WithoutTinasCommit'…
tnguyen7 Mar 8, 2018
b706166
Veronica's update - removed duplicate navigation button on dispatcher…
blanco7258 Mar 8, 2018
0e9c0f8
Merge branch 'Feb28WithoutTinasCommit' into adding_map
tnguyen7 Mar 8, 2018
3bc3a96
Fixed nav button to not stretch/always at bottom right
tnguyen7 Mar 8, 2018
7ea1020
Adjusted dispatch header padding slightly
tnguyen7 Mar 8, 2018
d267657
Merge pull request #2 from EMSTrack/adding_map
mcdeoliveira Mar 8, 2018
c29eb70
Making the Feb28 branch the new master after latest updates
Mar 8, 2018
bc491f3
Making changes to settings to conform to new server setup.
Mar 8, 2018
1ffc3ea
Attempt to merge with Tina's latest pull request.
mcdeoliveira Mar 9, 2018
0aebb72
Attempt to merge with Tina's latest pull request.
Mar 9, 2018
c3b4093
Attempt to merge with Tina's latest pull request.
Mar 9, 2018
9eedca7
Added Hospital model to models.
Mar 11, 2018
0c141d2
Merge branch 'devel' into devel_with_hospital_ui
Mar 11, 2018
40777a7
Added Hospital model to models.
Mar 11, 2018
0c4f87c
Updated app to use ExpandableRecyclerView;
Mar 12, 2018
d2aa559
Merge pull request #4 from EMSTrack/devel_with_hospital_ui
mcdeoliveira Mar 12, 2018
6b9a427
Added GPS utility class to calculate distance, bearing, etc.
Mar 14, 2018
d661081
Move logic to ForegroundService in preparation for Location updates i…
Mar 19, 2018
9cd9489
Added location services to AmbulanceForegroundService.
Mar 19, 2018
482f949
Bug fixes.
mcdeoliveira Mar 20, 2018
833849b
Updating location on resume.
Mar 20, 2018
ed25fa2
Replaced Dispatcher tab by Map.
mcdeoliveira Mar 21, 2018
361ae2d
Add my location to google map.
Mar 21, 2018
ebf8f37
Improve location accuracy by subscribing to 1 second gps updates and …
Mar 21, 2018
ab299a7
Update status on app. Be careful with update loop!
Mar 21, 2018
48863cc
Handling asynchronous tasks in LoginActivity.
Mar 22, 2018
e361c73
Handling asynchronous tasks in AmbulanceListActivity.
Mar 22, 2018
a97a540
Handling asynchronous tasks in AmbulanceListActivity.
Mar 22, 2018
3382c9a
Bug in calculation of bearing.
Mar 23, 2018
d187b8c
Bug in calculation of bearing.
Mar 23, 2018
a72b9d5
Improved Broadcast handling.
Mar 25, 2018
0791dd4
Update readme.md
mcdeoliveira Mar 25, 2018
e309a42
Fixed navigation issue when app is swipped and ambulance is already s…
Mar 25, 2018
093937b
Fixed bug that prevented snackbar messages when connection was unsucc…
Mar 26, 2018
91577a4
Instructions on how to install apk.
Mar 28, 2018
a53c182
Instructions on how to install apk.
Mar 28, 2018
cdeea67
Adding ambulances to map.
Mar 28, 2018
330b16d
Refactored tabLayout and pager.
mcdeoliveira Mar 29, 2018
6c15db3
Polishing map interface
Mar 29, 2018
c0ce736
Avoiding spinner in AmbulanceFragment from triggering event when upda…
Mar 29, 2018
92bd766
Made login and ambulance list logo same size.
Mar 29, 2018
902217b
Added will and online/offline/disconnected handshake to MqttProfileCl…
Mar 29, 2018
1bb4a9f
Client login and logout.
Apr 2, 2018
4c12b9d
Client login and logout.
Apr 2, 2018
e6f19a0
Map with ambulance for own user and auto centering.
Apr 2, 2018
66efa04
Fixed bug that did not refresh own ambulance in map update.
Apr 2, 2018
967372a
Adding hospitals to map.
Apr 3, 2018
7c28751
Updated client_id to reflect new version.
mcdeoliveira Apr 3, 2018
f9cf6cd
Reconnect and connect issues.
mcdeoliveira Apr 4, 2018
471392b
Making sure subscriptions are restored after reconnect.
Apr 4, 2018
18cc6ba
Handling orientation changes.
mcdeoliveira Apr 4, 2018
8ccb84f
Adding buffer to store updates when not online.
Apr 5, 2018
b15ce2e
Request location updates as a service.
Apr 5, 2018
439b453
Embedding ambulance location client handshake in service.
mcdeoliveira Apr 6, 2018
675e61f
Fixing bugs on map and location updates.
Apr 6, 2018
2f5ddad
Struggling with restoring location updates on reconnect.
mcdeoliveira Apr 6, 2018
c133e96
Fixing issues with reconnect.
Apr 8, 2018
41e3067
Adding online state.
Apr 11, 2018
81fa06f
Fixing notifications and keeping track on online state.
Apr 12, 2018
8b11bfe
Updating connect activities.
mcdeoliveira Apr 13, 2018
84fe406
App version and client name as strings.
mcdeoliveira Apr 13, 2018
7fe1c7d
Fixing login and reconnect issues.
Apr 13, 2018
7d28031
Changed from BroadcastReceiver to LocationCallback to allow for local…
Apr 13, 2018
6de3d7d
App version and client name as strings.
mcdeoliveira Apr 13, 2018
b3ad0e4
Update messages with client-id to match new version of server.
Apr 14, 2018
3549da3
Fixed reconnection issue that prevented location streaming to resume.
Apr 14, 2018
8c0a853
Adding support for geofencing.
mcdeoliveira Apr 24, 2018
9e66769
Adding support for geofencing.
mcdeoliveira Apr 24, 2018
b4aea54
Moved the GeofenceBroadcastReceiver to a separate class.
Apr 24, 2018
5a1a034
added skeleton for removing geofences; no way to trigger currently
Apr 25, 2018
88a3a0c
removing geofences appears to work; need to figure out how to trigger…
Apr 25, 2018
8f2dc77
Merge remote-tracking branch 'origin/devel-geofence' into devel-geofence
Apr 26, 2018
e33a1eb
Add build timestamp.
Apr 26, 2018
e9b2c75
Added about and settings to menu.
Apr 26, 2018
e6226f5
Merge remote-tracking branch 'origin/devel' into devel
Apr 26, 2018
d29616c
Added about and settings options for menu.
mcdeoliveira Apr 27, 2018
88e6701
Using gcm to identify client id.
mcdeoliveira Apr 27, 2018
df7656b
Using gcm to identify client id.
mcdeoliveira Apr 27, 2018
091cc5a
Using gcm to identify client id.
mcdeoliveira Apr 27, 2018
080b998
confirmed that broadcast receiver works properly
May 2, 2018
e27e5e6
merged changes
May 2, 2018
cd0cd05
Created call class to handle parsing of calls from server
May 9, 2018
abcf92d
added new tester for calls
May 9, 2018
11a0ac1
updated fields in Call.java; started skeleton for accepting calls in …
May 9, 2018
779b9be
Merge branch 'devel-geofence' of https://github.com/EMSTrack/CleanApp…
May 9, 2018
50cb4f3
added call unit tester
May 9, 2018
664780d
finished step 2, minus prompting user for dialog
May 10, 2018
52a942f
completed steps 2 to 5 and set up skeleton for 6 to 10 for wesley; pr…
lwuleonwu May 14, 2018
ff5f8f6
Implemented function to create dialog box for accepting incoming calls
yblank1 May 16, 2018
be73f94
Implemented accepting calls step 7
May 17, 2018
144d438
steps 1 to 5 seem to work; moved step 5 into replyToAcceptCall()
lwuleonwu May 17, 2018
017ff5f
Merge branch 'devel-geofence' of https://github.com/EMSTrack/CleanApp…
May 23, 2018
bf4d5f9
implement server accept call step 6 and 8
May 23, 2018
e854996
Create geofence transition intents and replies
May 30, 2018
def0e25
call acceptance dialog sometimes shows up
lwuleonwu May 30, 2018
276861a
need to finish telling the difference between patient and hospital ge…
lwuleonwu May 30, 2018
6c92c33
new globals defined; logic needs to be implemented
May 31, 2018
ad5bb3a
moved publishing into one function
May 31, 2018
994e1bf
all 10 steps for accepting calls finished; testing still to be done
lwuleonwu Jun 3, 2018
d793970
clean up before merge
Jun 5, 2018
64d9d80
Merge pull request #11 from EMSTrack/devel-geofence
mcdeoliveira Jun 5, 2018
98a44aa
Added about and settings to menu.
Jun 6, 2018
46ab1d4
Revamping call acceptance protocol.
mcdeoliveira Jun 6, 2018
a063a6e
Revamping call acceptance protocol.
mcdeoliveira Jun 6, 2018
48e6d86
Improving call handshake.
Jun 7, 2018
e84c8f0
Automatically starting to update location after logging in.
Aug 20, 2018
f43b4e9
Make statusSpinner be colorful.
Aug 21, 2018
bc8309a
Adding dialog to prevent user from disconnecting without warning.
Aug 21, 2018
07d94b4
Streamlining request to update server when another client is logged i…
Aug 22, 2018
d5f8cc0
Streamlining request to update server when another client is logged i…
Aug 22, 2018
5104c06
Streamlining request to update server when another client is logged i…
Aug 22, 2018
6482e04
Updated client version number.
Aug 22, 2018
bf3eb47
Streamlined ambulance selection directly from the MainApplication.
Aug 23, 2018
ee89fa9
basic message timeout (logging only)
lwuleonwu Oct 24, 2018
006a4c1
Reverted previous commit
Oct 24, 2018
a8773d2
implemented message timeout feature (needs testing)
lwuleonwu Oct 25, 2018
606a170
merged from devel
lwuleonwu Oct 25, 2018
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
30 changes: 24 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId 'org.emstrack.hospital'
minSdkVersion 16
applicationId 'org.emstrack.ambulance'
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resValue "string", "google_maps_key",
(project.findProperty("GOOGLE_MAPS_API_KEY") ?: "")
vectorDrawables.useSupportLibrary = true

// add build timestamp
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
}
buildTypes {
debug {
Expand All @@ -34,15 +40,27 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:27.0.2'

compile 'com.google.android.gms:play-services-location:15.0.0'
compile 'com.google.android.gms:play-services-maps:15.0.0'
compile 'com.google.android.gms:play-services-gcm:15.0.0'

compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'

compile 'com.google.code.gson:gson:2.8.0'

compile 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0'
compile 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.android.support:support-v4:27.0.2'
compile 'com.daimajia.swipelayout:library:1.2.0@aar'

compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.android.support:support-v4:27.1.0'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:design:27.1.0'

// compile 'com.daimajia.swipelayout:library:1.2.0@aar'
compile 'com.thoughtbot:expandablerecyclerview:1.3'

compile project(':models')
compile project(':mqtt')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.emstrack.hospital;
package org.emstrack.ambulance;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
Expand Down
54 changes: 43 additions & 11 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.emstrack.hospital">
package="org.emstrack.ambulance">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:name=".HospitalApp"
android:name=".AmbulanceApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher2"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher2"
android:supportsRtl="true"
android:theme="@style/CustomTheme">
android:launchMode="singleTop"
android:theme="@style/AppTheme">


<activity android:name="org.emstrack.hospital.LoginActivity"
<activity android:name="org.emstrack.ambulance.LoginActivity"
android:screenOrientation="nosensor">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name="org.emstrack.hospital.HospitalListActivity"
android:screenOrientation="nosensor">
</activity>

<activity android:name="org.emstrack.hospital.HospitalEquipmentActivity"
<activity android:name="org.emstrack.ambulance.MainActivity"
android:parentActivityName=".LoginActivity"
android:screenOrientation="nosensor">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".LoginActivity" />
</activity>

<service android:name="org.eclipse.paho.android.service.MqttService"/>
<service android:name=".services.AmbulanceForegroundService"/>

<receiver
android:name=".services.GeofenceBroadcastReceiver"
android:enabled="true"
android:exported="true" />

<!--
<receiver android:name=".services.AmbulanceForegroundService$LocationUpdatesBroadcastReceiver"
android:exported="true">
<intent-locationFilter>
<action android:name=".AmbulanceForegroundService.BroadcastActions.LOCATION_UPDATE" />
</intent-locationFilter>
</receiver>
-->


<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<!--
The API key for Google Maps-based APIs.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />

</application>

</manifest>
11 changes: 11 additions & 0 deletions app/src/main/java/org/emstrack/ambulance/AmbulanceApp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.emstrack.ambulance;

import android.app.Application;

/**
* Created by mauricio on 2/10/2018.
*/

public class AmbulanceApp extends Application {

}
69 changes: 69 additions & 0 deletions app/src/main/java/org/emstrack/ambulance/DispatcherCall.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package org.emstrack.ambulance;

import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;

import static android.content.ContentValues.TAG;

/**
* Created by sinan on 6/6/2017.
*
* This class is meant to create a call object that is sent from the dispatcher. It will contain
* a lot of information, so having it in its own separate class can save time.
*/

public class DispatcherCall {
String callString;
String address1 = "No Address Received";
static String latitude = "32.879409";
static String longitude = "-117.2382162";
String description = "No description received";

DispatcherCall(JSONObject c) {
try {
//GET EVERY SINGLE PART OF THE JSON OUT THE WAY
int id = c.getInt("id");
latitude = c.getString("latitude");
longitude = c.getString("longitude");
String name = c.getString("name");
int resU = c.getInt("residential_unit");
int stmain_number = c.getInt("stmain_number");
int delegation = c.getInt("delegation");
int zipcode = c.getInt("zipcode");
String city = c.getString("city");
String state = c.getString("state");
String assignment = c.getString("assignment");
description = c.getString("description");
String call_time = c.getString("call_time");
String departure_time = c.getString("departure_time");
String transfer_time = c.getString("transfer_time");
String hospital_time = c.getString("hospital_time");
String base_time = c.getString("base_time");
int amb = c.getInt("ambulance");

//format to save the address. This is temporary and might be changed based on server team
address1 = stmain_number + " street name pending " + "#" + resU + " " + city + " " + state + " " + zipcode;

//LOG EVERYTHING JUST TO MAKE SURE OF THIS
Log.d(TAG, "Call message received: and address is " + address1);
}
catch (JSONException e) { Log.d(TAG, "json error"); }

//save the call
callString = c.toString();
}

String getAddress() {
return address1;
}

public static String getLong() {
return longitude;
}

public static String getLatitude() {
return latitude;
}

}
Loading