This is an Android smartwatch app made with: Jetpack Compose, Room Database, Preferences Datastore
Be sure to read this when cloning the project! (Click to open)
I recommend you to use an Azure MySQL database. When you have cloned the project, move the API folder to a folder of your choice.
Open a terminal and execute the following:
npm installNow do the following:
- Create a ".env" file in your root folder.
- Copy these and change the placeholders with your database connection details.
DB_DATABASE={DATABASE NAME}
DB_USERNAME={USERNAME}
DB_PASSWORD={PASSWORD}
DB_HOST={HOSTNAME}- If you want to use a SSL connection you have to download your certificate and place it in the root of the project folder. (Azure MySQL database: Click on settings > networks | Here you can download the SSL-certficate) If you don't want to use SSL, remove line 23 which should look like the following code:
ssl: { ca: fs.readFileSync("DigiCertGlobalRootCA.crt.pem") }Import the following into your MySQL database:
CREATE DATABASE IF NOT EXISTS `neglectapp`;
USE `neglectapp`;
DROP TABLE IF EXISTS `sessions`;
CREATE TABLE `sessions` (
`id` int NOT NULL AUTO_INCREMENT,
`Datum` datetime DEFAULT NULL,
`Interactie` tinyint DEFAULT NULL,
`Hartslag` int DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb3;
-
Clone the project to a folder of your choice.
-
Open the project in Android Studio.
-
Wait for Android Studio to run the gradle scripts.
-
Change the API_URL variable in Core > Constants.kt to the desired API URL
If the API is running on localhost or your URL is not HTTPS, you have to also edit the IP adress in res > xml > network_security_config.xml (Android doesn't like connecting to HTTP)
... <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">PLACE LOCAL IP ADRESS HERE</domain> </domain-config> ...
-
Ready to build
Click here to reveal the instructions
Make sure you have adb installed and setup correctly.
Before we can extract our .csv file we have to make sure that the smartwatch has developer options enabled. (This is required to connect over Wi-Fi - since most watches don't have an USB-port connection.)
To enable developer options (This may be different depending the OS), do the following:
- Open the watch's Settings.
- Tap System > About.
- Scroll to Build number and tap the build number seven times.
- A dialog will appear confirming that you are now a developer.
- Open the watch's Settings.
- Tap Developer options > Debug over Wi-Fi.
- After a moment the screen will display the watch's IP address (for example
192.168.1.100). You'll need this for the next step, so make a note of it.
-
Connect your watch and development machine to the same network.
-
Connect the debugger to the watch using the watch's IP address. For example, if the IP address is
192.168.1.100, the adb connect command and its response will look like this (a port number,5555is added to the address):
adb connect 192.168.1.100:5555
connected to 192.168.1.100:5555
The watch is now connected to the debugger and you're ready to start debugging.
Send adb commands to the watch using the -s flag and specify the watch's IP address, including the port number:
adb -s 192.168.1.100:5555 <command>
If you are not using the emulator and have only one device connected for debugging, you don't need to specify the address at all.
This will download the NeglectAppData.csv file to your chosen folder.
adb pull "/sdcard/Documents/NeglectApp/NeglectAppData.csv" "C:\Users\USER\FOLDER_LOCATION"Code is can be improved at some areas.
-
Choose & save operating hours
-
Choose & save minimum and maximum amount of sessions
-
Configurable stimula (Vibration, Light, Sound)
-
Configurable stimula intensity
-
Implement intensities
-
Show a functioning progress bar on landing screen (represents operating hours)
-
Pause & resume ability
-
Show an alarm screen
-
Customize alarm screen with the chosen stimula
-
Trigger a random amount of stimula between operating hours
-
Implement ongoing activity
-
Ability to close the alarm
-
Auto close alarm after 15 seconds
-
Save time when alarm is triggered and if the user interacted with the alarm
-
Save data local
-
Save data to Azure
-
Unit testing
-
Check if I'm able to start the service automatically on starting hour
-
Heartrate
-
Detect movement before stimula is triggered
-
Optimization
-
Animated icon for Ongoing Activity (wear homescreen icon)
-
MVVM - Pattern
-
Show data (Interactions) on a circle graph
-
UI testing