Skip to content

Commit 0a5c934

Browse files
committed
added notifications
1 parent 89052bb commit 0a5c934

File tree

13 files changed

+67
-32
lines changed

13 files changed

+67
-32
lines changed
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.

Android/Layout_Version/.idea/workspace.xml

Lines changed: 23 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

Android/Layout_Version/app/build/intermediates/incremental/packageDebug/tmp/debug/dex-renamer-state.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Sat Apr 29 19:55:59 EDT 2023
1+
#Sun Apr 30 21:37:57 EDT 2023
22
path.4=2/classes.dex
33
path.3=13/classes.dex
44
path.2=10/classes.dex
Binary file not shown.

Android/Layout_Version/app/src/main/java/com/example/layout_version/Account/Account_Page_Forgot_Password.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ protected void onCreate(Bundle savedInstanceState) {
2222
setContentView(R.layout.account_reset);
2323
account = Account.getInstance();
2424

25+
Notifications notif = new Notifications(this);
26+
NotificationManagerCompat managerCompat = NotificationManagerCompat.from(this);
27+
notif.send_Forgot_Password_Notification(managerCompat);
28+
2529
TextView username = findViewById(R.id.username);
2630

2731
Button sendBtn = findViewById(R.id.send);

Android/Layout_Version/app/src/main/java/com/example/layout_version/Bluetooth/BluetoothManager.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ public class BluetoothManager {
3131
private InputStream inputStream;
3232
private OutputStream outputStream;
3333

34+
public boolean connected;
35+
3436
public BluetoothManager() {
37+
3538
bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
39+
connected = false;
3640
}
3741

3842
@SuppressLint("MissingPermission")
@@ -45,6 +49,7 @@ public boolean connectToDevice(String deviceAddress) {
4549
outputStream = socket.getOutputStream();
4650
read();
4751
write("Change name\nnew_device");
52+
connected = true;
4853
return true;
4954
} catch (IOException e) {
5055
Log.e(TAG, "Error connecting to device", e);
@@ -122,4 +127,7 @@ private void showDeviceListDialog(Set<BluetoothDevice> pairedDevices, Context co
122127
builder.setNegativeButton("Cancel", (dialog, which) -> dialog.dismiss());
123128
builder.create().show();
124129
}
130+
public boolean getConnected(){
131+
return connected;
132+
}
125133
}

Android/Layout_Version/app/src/main/java/com/example/layout_version/Bluetooth_Page.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ public class Bluetooth_Page extends AppCompatActivity {
1515
@Override
1616
protected void onCreate(Bundle savedInstanceState) {
1717
super.onCreate(savedInstanceState);
18-
Notifications notif = new Notifications(this);
19-
NotificationManagerCompat managerCompat = NotificationManagerCompat.from(this);
20-
notif.send_Bluetooth_Notification(managerCompat);
2118
setContentView(R.layout.bluetooth_hardware_page);
2219

2320
Button serialbtn = findViewById(R.id.serialButton);
2421

2522
serialbtn.setOnClickListener(view -> {
2623
BluetoothManager bluetoothManager = new BluetoothManager();
2724
bluetoothManager.show_bluetooth_devices(this);
25+
if(bluetoothManager.getConnected()){
26+
Notifications notif = new Notifications(this);
27+
NotificationManagerCompat managerCompat = NotificationManagerCompat.from(this);
28+
notif.send_Bluetooth_Notification(managerCompat);
29+
}
2830
});
2931
}
3032
}

0 commit comments

Comments
 (0)