Skip to content

Commit 795b009

Browse files
committed
Update notifications to create only single proxmity alert
1 parent f7f80da commit 795b009

File tree

9 files changed

+21
-12
lines changed

9 files changed

+21
-12
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<p align="center">
1515
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.
1616
<br />
17-
<a href="https://github.com/kavindaperera/nova-shield/tree/development/docs"><strong>Explore the docs »</strong></a>
17+
<a href="https://github.com/kavindaperera/nova-shield/tree/development/docs/NOVA_Shield_Documentation.pdf"><strong>Explore the docs »</strong></a>
1818
<br />
1919
<br />
2020
<a href="https://github.com/kavindaperera/nova-shield">View Demo</a>
@@ -67,12 +67,10 @@ The user can enter a nickname to be used within the app and simply press the <st
6767
</p>
6868

6969
<p align="justify">
70-
71-
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.
72-
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.
73-
70+
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.
7471
</p>
7572

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

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

8482
<p align="justify">
85-
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.
83+
84+
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.
85+
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.
86+
8687
</p>
8788

89+
90+
8891
<p align="right">(<a href="#top">back to top</a>)</p>
8992

9093
### Notification Alerts
9194
<p align="">
9295
<img src="./docs/ui/notifications_0.jpg" alt="notifications" width="150"/>
93-
<img src="./docs/ui/notifications_1.jpg" alt="notifications" width="150"/>
96+
<img src="./docs/ui/notifications_2.jpg" alt="notifications" width="150"/>
9497
</p>
9598

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

106109
<p align="justify">
107110
A user can access the Friends Screen by pressing the Friends Tab on the bottom navigation bar.
108-
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.
109-
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.
111+
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.
112+
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.
110113
</p>
111114
<p align="right">(<a href="#top">back to top</a>)</p>
112115

Shield/app/src/main/java/com/nova/android/shield/utils/Constants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ public class Constants {
2929
public static final String DEEP_LINK_QR = "qr";
3030
public static int deviceID;
3131
public static List<String> deviceNames = new LinkedList();
32-
public static final int FOREGROUND_SERVICE = 444;
32+
public static final int FOREGROUND_SERVICE = 4;
3333
public static String[] LOCATION_PERMISSIONS = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};
3434
public static String[] LOCATION_PERMISSIONS_LOWER = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};
35+
public static final String SERVICE_NOTIFICATION_CHANNEL = "shield_service_channel";
3536
public static List<String> manufacturerNames = new LinkedList();
3637
public static final String MSG_DATE_YESTERDAY = "Yesterday";
3738
public static final String NOTIFICATION_CHANNEL = "shield_channel";

Shield/app/src/main/java/com/nova/android/shield/utils/Utils.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,14 @@ public static void sendNotification(Context context, String title, String msg, i
158158
notifBuilder.setLargeIcon(largeIcon);
159159
}
160160

161-
int notifId = ShieldPreferencesHelper.getNotifId(context);
161+
int notifId = 1; // create only one proximity warning
162+
163+
if (type!=3){
164+
notifId = ShieldPreferencesHelper.getNotifId(context);
165+
ShieldPreferencesHelper.setNotifId(context, notifId);
166+
}
167+
162168
mNotificationManager.notify(notifId, notifBuilder.build());
163-
ShieldPreferencesHelper.setNotifId(context, notifId);
164169

165170
}
166171
}

docs/NOVA_Shield_Documentation.pdf

1.12 MB
Binary file not shown.

docs/ui/notifications_0.jpg

25.7 KB
Loading

docs/ui/notifications_1.jpg

258 KB
Loading

docs/ui/notifications_2.jpg

306 KB
Loading

docs/ui/shield_0.png

18.5 KB
Loading

docs/ui/shield_1.png

17.7 KB
Loading

0 commit comments

Comments
 (0)