To use the prototype Android app, please follow the instructions below:
Before attempting to run any Python code, set up a Conda environment using the environment.yml
file provided.
To do this open a terminal in the server directory of this project and run the he following command to create a new Conda environment:
conda env create --file environment.yml
Next activate the Conda environment using the command:
conda activate gym_classification
- Make sure you have set up the Flask server by running the following command in the root of the server directory:
flask run --host=0.0.0.0
-
In the root directory of the project, navigate to the server directory.
-
Start the Flask server by running the following command:
flask run --host=0.0.0.0
This will start the Flask server on your local machine.
-
Once the server is running, copy the IP address displayed at the bottom of the terminal/console.
-
Open the MainActivity.java file located in the front-end code of the Android app.
-
Look for line 122 in the MainActivity.java file, which should contain the URL for the Flask server.
-
Replace the existing IP address in the URL with the IP address you copied in step 3.
line 122 should look like this once completed : sendPostRequest("your_url
/predict", sensorData);
-
Enable developer mode and USB debugging on your Android phone. Refer to the official documentation for your specific Android device on how to enable these options.
-
Connect your Android phone to your computer via USB.
-
Open the project in Android Studio.
-
Build the app onto your Android phone using Android Studio.
-
Once the app is successfully installed on your phone, you can launch and use it for gym exercise classification.