Skip to content

Commit

Permalink
Update notifications to create only single proxmity alert
Browse files Browse the repository at this point in the history
  • Loading branch information
kavindaperera committed Mar 25, 2022
1 parent f7f80da commit 795b009
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 12 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<p align="center">
Shield is a Social Distancing Reminder app. The app will identify when another person (someone with a phone and the app) comes too close to you using BLE RSSI (Received Signal Strength Indicator). This will be useful in places such as universities and offices where everyone has a smartphone and will have the application installed.
<br />
<a href="https://github.com/kavindaperera/nova-shield/tree/development/docs"><strong>Explore the docs »</strong></a>
<a href="https://github.com/kavindaperera/nova-shield/tree/development/docs/NOVA_Shield_Documentation.pdf"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://github.com/kavindaperera/nova-shield">View Demo</a>
Expand Down Expand Up @@ -67,12 +67,10 @@ The user can enter a nickname to be used within the app and simply press the <st
</p>

<p align="justify">

A user can start the Shield protection service by pressing the <img src="./docs/ui/start_btn.png" alt="start" width="30"/> button on the bottom right corner of the home screen. This will start a simple animation on the home screen which indicates that the Shield protection is ON. The user can leave the app after this and still the application will be running in the background.
If the user needs to stop the Shield protection, then he/she needs to press the <img src="./docs/ui/stop_btn.png" alt="pause" width="30"/> button.

Shield app requires the users to grant location access permission. When the user first launches the app, a pop-up dialog box will appear as shown in the first figure. The user can then select the Yes option which will open the phone’s settings. Then user can grant the required permission as shown in the second figure. In order to run the app, it needs phone’s Bluetooth to be turned on. If Bluetooth is not on, then a pop-up dialog as shown in the third figure will appear.
</p>


<p align="right">(<a href="#top">back to top</a>)</p>

### Home
Expand All @@ -82,15 +80,20 @@ If the user needs to stop the Shield protection, then he/she needs to press the
</p>

<p align="justify">
Shield app requires the users to grant location access permission. When the user first launches the app, a pop-up dialog box will appear as shown in the first figure. The user can then select the Yes option which will open the phone’s settings. Then user can grant the required permission as shown in the second figure. In order to run the app, it needs phone’s Bluetooth to be turned on. If Bluetooth is not on, then a pop-up dialog as shown in the third figure will appear.

A user can start the Shield protection service by pressing the <img align="center" src="./docs/ui/start_btn.png" alt="start" width="30"/> button on the bottom right corner of the home screen. This will start a simple animation on the home screen which indicates that the Shield protection is ON. The user can leave the app after this and still the application will be running in the background.
If the user needs to stop the Shield protection, then he/she needs to press the <img align="center" src="./docs/ui/stop_btn.png" alt="pause" width="30"/> button.

</p>



<p align="right">(<a href="#top">back to top</a>)</p>

### Notification Alerts
<p align="">
<img src="./docs/ui/notifications_0.jpg" alt="notifications" width="150"/>
<img src="./docs/ui/notifications_1.jpg" alt="notifications" width="150"/>
<img src="./docs/ui/notifications_2.jpg" alt="notifications" width="150"/>
</p>

<p align="right">(<a href="#top">back to top</a>)</p>
Expand All @@ -105,8 +108,8 @@ Shield app requires the users to grant location access permission. When the user

<p align="justify">
A user can access the Friends Screen by pressing the Friends Tab on the bottom navigation bar.
By pressing the <img src="./docs/ui/add_btn.png" alt="add" width="30"/> button on the bottom right corner, a user can get the Scan QR Code & Display QR Code options. Using the Scan QR Code option, a user can scan the Shield QR Code of a close friend and add him/her to the whitelist. Using the Display QR Code option, a user can show his/her Shield QR Code to another person to scan.
Once a user has added some friends to the whitelist, a <img src="./docs/ui/dlt_btn.png" alt="delete" width="30"/> button is shown at the bottom right corner if the user wants to remove someone from the whitelist.
By pressing the <img align="center" src="./docs/ui/add_btn.png" alt="add" width="30"/> button on the bottom right corner, a user can get the Scan QR Code & Display QR Code options. Using the Scan QR Code option, a user can scan the Shield QR Code of a close friend and add him/her to the whitelist. Using the Display QR Code option, a user can show his/her Shield QR Code to another person to scan.
Once a user has added some friends to the whitelist, a <img align="center" src="./docs/ui/dlt_btn.png" alt="delete" width="30"/> button is shown at the bottom right corner if the user wants to remove someone from the whitelist.
</p>
<p align="right">(<a href="#top">back to top</a>)</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ public class Constants {
public static final String DEEP_LINK_QR = "qr";
public static int deviceID;
public static List<String> deviceNames = new LinkedList();
public static final int FOREGROUND_SERVICE = 444;
public static final int FOREGROUND_SERVICE = 4;
public static String[] LOCATION_PERMISSIONS = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};
public static String[] LOCATION_PERMISSIONS_LOWER = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};
public static final String SERVICE_NOTIFICATION_CHANNEL = "shield_service_channel";
public static List<String> manufacturerNames = new LinkedList();
public static final String MSG_DATE_YESTERDAY = "Yesterday";
public static final String NOTIFICATION_CHANNEL = "shield_channel";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,14 @@ public static void sendNotification(Context context, String title, String msg, i
notifBuilder.setLargeIcon(largeIcon);
}

int notifId = ShieldPreferencesHelper.getNotifId(context);
int notifId = 1; // create only one proximity warning

if (type!=3){
notifId = ShieldPreferencesHelper.getNotifId(context);
ShieldPreferencesHelper.setNotifId(context, notifId);
}

mNotificationManager.notify(notifId, notifBuilder.build());
ShieldPreferencesHelper.setNotifId(context, notifId);

}
}
Expand Down
Binary file added docs/NOVA_Shield_Documentation.pdf
Binary file not shown.
Binary file modified docs/ui/notifications_0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/ui/notifications_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/ui/notifications_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/ui/shield_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/ui/shield_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 795b009

Please sign in to comment.