diff --git a/app/build.gradle.kts b/app/build.gradle.kts index aaf59211..0446599f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -27,7 +27,7 @@ android { defaultConfig { applicationId = "com.example.platform" - minSdk = 21 + minSdk = 23 targetSdk = 36 versionCode = 1 versionName = "1.0" @@ -80,6 +80,7 @@ dependencies { implementation(project(":samples:connectivity:bluetooth:companion")) implementation(project(":samples:connectivity:callnotification")) implementation(project(":samples:connectivity:telecom")) + implementation(project(":samples:connectivity:UwbRanging")) implementation(project(":samples:graphics:pdf")) implementation(project(":samples:graphics:ultrahdr")) implementation(project(":samples:location")) diff --git a/app/src/main/java/com/example/platform/app/ApiSurface.kt b/app/src/main/java/com/example/platform/app/ApiSurface.kt index 9ca31ca0..2189489e 100644 --- a/app/src/main/java/com/example/platform/app/ApiSurface.kt +++ b/app/src/main/java/com/example/platform/app/ApiSurface.kt @@ -195,6 +195,12 @@ val UserInterfaceWindowManagerApiSurface = ApiSurface( null, ) +val ConnectivityUwbRangingApiSurface = ApiSurface( + "connectivity-uwb-ranging", + "Connectivity UWB Ranging", + null, +) + val API_SURFACES = listOf( AccessiblityApiSurface, CameraCamera2ApiSurface, @@ -204,6 +210,7 @@ val API_SURFACES = listOf( ConnectivityBluetoothCompanionApiSurface, ConnectivityCallNotificationApiSurface, ConnectivityTelecomApiSurface, + ConnectivityUwbRangingApiSurface, GraphicsPdfApiSurface, GraphicsUltraHdrApiSurface, LocationApiSurface, diff --git a/app/src/main/java/com/example/platform/app/SampleDemo.kt b/app/src/main/java/com/example/platform/app/SampleDemo.kt index 1019b215..c61fb309 100644 --- a/app/src/main/java/com/example/platform/app/SampleDemo.kt +++ b/app/src/main/java/com/example/platform/app/SampleDemo.kt @@ -128,6 +128,7 @@ import com.example.platform.ui.text.LineBreak import com.example.platform.ui.text.Linkify import com.example.platform.ui.text.TextSpanFragment import com.example.platform.ui.windowmanager.demos.WindowDemosActivity +import com.google.uwb.hellouwb.ui.UwbRangingActivity interface SampleDemo : CatalogItem { override val id: String @@ -367,6 +368,14 @@ val SAMPLE_DEMOS by lazy { } }, ), + ActivitySampleDemo( + id = "connectivity-uwb-ranging", + name = "UWB Ranging", + description = "Demonstrates how to use the UWB APIs to perform ranging.", + documentation = "https://developer.android.com/guide/topics/connectivity/uwb", + apiSurface = ConnectivityUwbRangingApiSurface, + content = UwbRangingActivity::class.java + ), ComposableSampleDemo( id = "pdf-renderer", name = "PDF Renderer", diff --git a/build.gradle.kts b/build.gradle.kts index 63ab9bb0..19c3c23c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,4 +18,5 @@ plugins { alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.compose) apply false alias(libs.plugins.android.library) apply false + alias(libs.plugins.protobuf) apply false } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fee87e84..eaf275b6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -63,11 +63,16 @@ tensorflowLiteGpuDelegatePlugin = "0.4.4" tensorflowLiteSupport = "0.4.2" barcodeScanningCommon = "17.0.0" playServicesMlkitBarcodeScanning = "18.3.1" +protobuf = "0.9.4" +firebaseCrashlyticsBuildtools = "3.0.5" +uwb = "1.0.0-alpha10" + [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } androidx-fragment-compose = { module = "androidx.fragment:fragment-compose", version.ref = "fragmentCompose" } androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" } +androidx-uwb = { module = "androidx.core.uwb:uwb", version.ref = "uwb" } androidx-photopicker-compose = { module = "androidx.photopicker:photopicker-compose", version.ref = "photopickerCompose" } junit = { group = "junit", name = "junit", version.ref = "junit" } androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } @@ -198,6 +203,7 @@ tensorflow-lite-select-tf-ops = { module = "org.tensorflow:tensorflow-lite-selec tensorflow-lite-support = { module = "org.tensorflow:tensorflow-lite-support", version.ref = "tensorflowLiteSupport" } barcode-scanning-common = { group = "com.google.mlkit", name = "barcode-scanning-common", version.ref = "barcodeScanningCommon" } play-services-mlkit-barcode-scanning = { group = "com.google.android.gms", name = "play-services-mlkit-barcode-scanning", version.ref = "playServicesMlkitBarcodeScanning" } +firebase-crashlytics-buildtools = { group = "com.google.firebase", name = "firebase-crashlytics-buildtools", version.ref = "firebaseCrashlyticsBuildtools" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" } @@ -214,3 +220,4 @@ hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } +protobuf = { id = "com.google.protobuf", version.ref = "protobuf" } diff --git a/samples/connectivity/UwbRanging/.idea/workspace.xml b/samples/connectivity/UwbRanging/.idea/workspace.xml new file mode 100644 index 00000000..6a5944c6 --- /dev/null +++ b/samples/connectivity/UwbRanging/.idea/workspace.xml @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +