Merge branch 'main' of https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-4/muupooviixee66
This commit is contained in:
@@ -23,6 +23,7 @@ void Connectivity::connectWiFi(char* ssid, char* pass){
|
|||||||
const char* getServerURL = "http://145.92.8.132:443/get-ip";
|
const char* getServerURL = "http://145.92.8.132:443/get-ip";
|
||||||
String ipAddress = ""; // string that will hold the server's IP address
|
String ipAddress = ""; // string that will hold the server's IP address
|
||||||
|
|
||||||
|
/** Fetch the IP address of pepper from the server */
|
||||||
const char* Connectivity::fetchIPAddress() {
|
const char* Connectivity::fetchIPAddress() {
|
||||||
char* ipAddress = NULL; // Declare ipAddress as a char*
|
char* ipAddress = NULL; // Declare ipAddress as a char*
|
||||||
if (WiFi.status() == WL_CONNECTED) {
|
if (WiFi.status() == WL_CONNECTED) {
|
||||||
@@ -41,14 +42,14 @@ const char* Connectivity::fetchIPAddress() {
|
|||||||
ipAddress = strdup(ip);
|
ipAddress = strdup(ip);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Serial.printf("GET request failed, error: %s\n", http.errorToString(httpCode).c_str());
|
Serial.printf("GET request failed, error: %s\n", http.errorToString(httpCode).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
http.end();
|
http.end();
|
||||||
} else {
|
} else {
|
||||||
Serial.println("WiFi not connected");
|
Serial.println("WiFi not connected");
|
||||||
}
|
}
|
||||||
return ipAddress; // Add this return statement
|
return ipAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Send a POST request to a server with provided data */
|
/** Send a POST request to a server with provided data */
|
||||||
|
@@ -14,8 +14,8 @@
|
|||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
|
|
||||||
|
|
||||||
|
// declare the class Connectivity with all functions
|
||||||
class Connectivity {
|
class Connectivity {
|
||||||
public:
|
public:
|
||||||
void connectWiFi(char* ssid, char* pass);
|
void connectWiFi(char* ssid, char* pass);
|
||||||
void websocketSetup(char* ip, uint16_t port, char* adress);
|
void websocketSetup(char* ip, uint16_t port, char* adress);
|
||||||
|
@@ -1,4 +0,0 @@
|
|||||||
package com.example.fitbot.ui.activities;
|
|
||||||
|
|
||||||
public class CompletionActivity {
|
|
||||||
}
|
|
@@ -16,6 +16,5 @@ public class EndScreenActivity extends AppCompatActivity {
|
|||||||
NavigationManager.hideSystemUI(this);
|
NavigationManager.hideSystemUI(this);
|
||||||
|
|
||||||
NavigationManager.setupButtonNavigation(this, R.id.homeButtonEndScreen, MainActivity.class);
|
NavigationManager.setupButtonNavigation(this, R.id.homeButtonEndScreen, MainActivity.class);
|
||||||
NavigationManager.setupButtonNavigation(this, R.id.startButtonEndScreen, FitnessActivity.class);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -8,13 +8,14 @@
|
|||||||
tools:context=".ui.activities.HelpActivity">
|
tools:context=".ui.activities.HelpActivity">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/linearLayout"
|
||||||
android:layout_width="800dp"
|
android:layout_width="800dp"
|
||||||
android:layout_height="450dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="80dp"
|
android:layout_marginStart="80dp"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="80dp"
|
||||||
android:background="@drawable/border_background"
|
android:background="@drawable/border_background"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="16dp"
|
android:padding="40dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
@@ -26,8 +27,8 @@
|
|||||||
android:layout_marginBottom="40dp"
|
android:layout_marginBottom="40dp"
|
||||||
android:background="@drawable/border_background_3"
|
android:background="@drawable/border_background_3"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingVertical="15dp"
|
|
||||||
android:paddingHorizontal="20dp"
|
android:paddingHorizontal="20dp"
|
||||||
|
android:paddingVertical="15dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
@@ -56,27 +57,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:text="@string/voltooid"
|
android:text="@string/voltooid"
|
||||||
android:textAlignment="center"/>
|
android:textAlignment="center" />
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:background="@drawable/border_background_3"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:padding="16dp"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textViewScoreEndScreen"
|
|
||||||
style="@style/TextStyle"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="@string/score"
|
|
||||||
android:textAlignment="center"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -85,8 +66,8 @@
|
|||||||
android:id="@+id/homeButtonEndScreen"
|
android:id="@+id/homeButtonEndScreen"
|
||||||
android:layout_width="150dp"
|
android:layout_width="150dp"
|
||||||
android:layout_height="75dp"
|
android:layout_height="75dp"
|
||||||
android:layout_marginEnd="280dp"
|
android:layout_marginEnd="404dp"
|
||||||
android:layout_marginBottom="30dp"
|
android:layout_marginBottom="48dp"
|
||||||
android:background="@drawable/red_button_gradient"
|
android:background="@drawable/red_button_gradient"
|
||||||
android:drawableTop="@drawable/ic_baseline_home_48"
|
android:drawableTop="@drawable/ic_baseline_home_48"
|
||||||
android:drawableTint="@color/white"
|
android:drawableTint="@color/white"
|
||||||
@@ -94,20 +75,4 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/startButtonEndScreen"
|
|
||||||
android:layout_width="150dp"
|
|
||||||
android:layout_height="75dp"
|
|
||||||
android:layout_marginStart="280dp"
|
|
||||||
android:layout_marginBottom="30dp"
|
|
||||||
android:background="@drawable/red_button_gradient"
|
|
||||||
android:padding="15dp"
|
|
||||||
android:text="@string/start"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="30sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
Reference in New Issue
Block a user