Using Java/Android Studio for CMP354 -- Mobile Application Development -- Final Project -- Dr. Tamer Shanableh
- Make sure to allow location access always from your Virtual Device
- Allow app to use device storage
- Ensure Android SDK 29 or above is used
- Note: The permission is not prompted on launching the app. This must be set by the user in settings
-
I have made three accounts on the Database. You may use any of these:
+ username: hafezus password: abc + username: testuser password: asd + username: testuser1 password: aaa
-
Two of these users have updated their PCR test result for COVID-19 to positive
-
The application has 3 main fragment views: The dashboard, the map view, and the PCR test
-
The dashboard and the PCR test views are self-explanatory
-
The map view uses Geofencing to mark regions where COVID-positive users have entered. This is updated on the database every 30 minutes using a background service
+ *Note*: The current location is also sent whenever the user logs in, or if already logged in, start the app. Give it 5 seconds to update on the Map
-
When there is an update to the database, the user may have to re-enter this map view again to see the update
-
The geofence uses a Broadcast Receiver for 3 of the following states:
+ When a user enters a COVID-risk region + When the user exits the region, & + When the user still dwells in the same region
-
The geofence broadcast receiver is responsible for sending notifications for the state-transitions mentioned above
-
When the app is running (active or in background), the broadcast receiver is listening for these state transitions and sends a pop-up notification appropriately
-
The app also has a logout feature
- Make sure the permissions are set up manually from the emulator before running the app.
- Enter app
- Enter login credentials (Only the above three accounts are registered)
- Use navigation drawer on the left to navigate to different views
- Manually set up current location. For this, go to: "More" -> "Location" -> Create/Select saved point -> Set Location
- To test the notifications, you will have to update your current locations in and out of a geofence.
- In Covid Result view, you may update your PCR test result as Positive (For active), and Negative (If you no longer have corona)
- You may logout to stop running the background service for live-tracking
- Broadcast reciever notifies only when exiting app from the map view, or entering the map (this applies when there is a transition in states)
- The API fetches latest data, but app may crash if it fails to fetch this data (Network Error, thread-handling, etc)
- Firestore data access expiry will disable DB access by the App. App will crash
-
Geofence https://developer.android.com/training/location/geofencing.html https://github.com/trulymittal/Geofencing/tree/master/app/src https://www.youtube.com/watch?v=nmAtMqljH9M&ab_channel=yoursTRULY https://3en.cloud/insight/2018/4/24/setting-up-geofencing-with-notifications-on-android
-
Firestore https://firebase.google.com/docs/firestore/manage-data/add-data https://stackoverflow.com/questions/51245784/is-it-possible-to-create-a-new-document-automatically-in-cloud-firestore
-
Fragments/Navigation Drawers https://www.youtube.com/watch?v=pucQs0TUe0I&ab_channel=Stevdza-San
-
COVID API data https://covid19api.com/ https://documenter.getpostman.com/view/10808728/SzS8rjbc
-
Location/GPS Chgps_U20_gpsactivity (From study material in CMP354 by Dr. Tamer) https://stackoverflow.com/questions/45215637/how-to-get-current-location-in-background-service-in-android https://stackoverflow.com/questions/61092325/get-current-location-with-background-service-android https://droidbyme.medium.com/get-current-location-using-gps-network-provider-d2915f2ec7a5
-
Services/Notifications/Pending Intents ch10_U20_newsreader (From study material in CMP354 by Dr. Tamer) ch4_ex11_Reminder (From study material in CMP354 by Dr. Tamer) https://developer.android.com/reference/android/app/PendingIntent
Note: These were the primary sources that I used. I have not included the sources that I have found but ended up not being useful.