diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index b589d56e..b86273d9 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 0897082f..639c779c 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -4,6 +4,7 @@
-
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index b67486ec..bb270b80 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -3,15 +3,19 @@
+
+
+
+
@@ -33,6 +37,10 @@
+
+
+
+
@@ -57,6 +65,10 @@
+
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 8978d23d..0bd3ec25 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,6 +1,5 @@
-
-
+
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 8f60d557..5a8595a8 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -8,7 +8,7 @@ plugins {
android {
namespace = "com.greybox.projectmesh"
- compileSdk = 34
+ compileSdk = 35
defaultConfig {
applicationId = "com.greybox.projectmesh"
@@ -30,6 +30,13 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
+ signingConfig = signingConfigs.getByName("debug")
+ }
+
+ debug {
+ isDebuggable = true
+ applicationIdSuffix = ".debug"
+ versionNameSuffix = "-debug"
}
}
compileOptions {
@@ -70,6 +77,7 @@ dependencies {
implementation("androidx.compose.material3:material3:1.2.1")
implementation("androidx.compose.material:material-icons-core:1.6.8")
implementation("androidx.compose.material:material-icons-extended-android:1.6.8")
+ implementation(libs.androidx.foundation)
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
@@ -144,4 +152,7 @@ dependencies {
// For JSON serialisation
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
+
+ // For Debug Build
+ implementation("com.jakewharton.timber:timber:5.0.1")
}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 9896e93f..99119f3b 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -74,7 +74,7 @@
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
- android:theme="@style/Theme.ProjectMesh">
+ android:theme="@style/Theme.ProjectMesh.Launcher">
@@ -83,7 +83,7 @@
diff --git a/app/src/main/java/com/greybox/projectmesh/DeviceStatusManager.kt b/app/src/main/java/com/greybox/projectmesh/DeviceStatusManager.kt
new file mode 100644
index 00000000..53cde4dd
--- /dev/null
+++ b/app/src/main/java/com/greybox/projectmesh/DeviceStatusManager.kt
@@ -0,0 +1,322 @@
+package com.greybox.projectmesh
+
+import android.util.Log
+import com.greybox.projectmesh.server.AppServer
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.asStateFlow
+import kotlinx.coroutines.flow.update
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withTimeoutOrNull
+import java.net.InetAddress
+
+/**
+ * Centralized manager for tracking online/offline status of devices.
+ * This singleton provides a single source of truth that can be observed by different parts of the app.
+ */
+
+object DeviceStatusManager {
+ //private mutable state flow that stores device IP address to online status mapping
+ private val _deviceStatusMap = MutableStateFlow