diff --git a/common/src/commonMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfo.kt b/common/src/commonMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfo.kt new file mode 100644 index 00000000..dc873010 --- /dev/null +++ b/common/src/commonMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfo.kt @@ -0,0 +1,16 @@ +package net.dankito.utils.multiplatform.os + + +open class DeviceInfo( + open val manufacturer: String, + open val deviceModel: String, + open val osName: String, + open val osVersion: String, + open val osArch: String +) { + + override fun toString(): String { + return "$manufacturer $deviceModel: $osName $osVersion" + } + +} \ No newline at end of file diff --git a/common/src/commonMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfoRetriever.kt b/common/src/commonMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfoRetriever.kt new file mode 100644 index 00000000..6e4530d0 --- /dev/null +++ b/common/src/commonMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfoRetriever.kt @@ -0,0 +1,8 @@ +package net.dankito.utils.multiplatform.os + + +expect class DeviceInfoRetriever { + + fun getDeviceInfo(): DeviceInfo + +} \ No newline at end of file diff --git a/common/src/iosMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfoRetriever.kt b/common/src/iosMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfoRetriever.kt new file mode 100644 index 00000000..f963eaf9 --- /dev/null +++ b/common/src/iosMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfoRetriever.kt @@ -0,0 +1,11 @@ +package net.dankito.utils.multiplatform.os + + +actual class DeviceInfoRetriever { + + actual fun getDeviceInfo(): DeviceInfo { + // TODO: + return DeviceInfo("", "", "", "", "") + } + +} \ No newline at end of file diff --git a/common/src/jvmMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfoRetriever.kt b/common/src/jvmMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfoRetriever.kt new file mode 100644 index 00000000..5057aaba --- /dev/null +++ b/common/src/jvmMain/kotlin/net/dankito/utils/multiplatform/os/DeviceInfoRetriever.kt @@ -0,0 +1,11 @@ +package net.dankito.utils.multiplatform.os + + +actual class DeviceInfoRetriever { + + actual fun getDeviceInfo(): DeviceInfo { + // TODO: retrieve manufacturer and device model + return DeviceInfo("", "", System.getProperty("os.name", ""), System.getProperty("os.version", ""), System.getProperty("os.arch", "")) + } + +} \ No newline at end of file