Skip to content

Commit d440341

Browse files
authored
Merge pull request #322 from bobwzy/hello-uwb
Add HelloUwb ranging demoapp.
2 parents e02056f + adae917 commit d440341

File tree

76 files changed

+4317
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+4317
-1
lines changed

app/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ android {
2727

2828
defaultConfig {
2929
applicationId = "com.example.platform"
30-
minSdk = 21
30+
minSdk = 23
3131
targetSdk = 36
3232
versionCode = 1
3333
versionName = "1.0"
@@ -80,6 +80,7 @@ dependencies {
8080
implementation(project(":samples:connectivity:bluetooth:companion"))
8181
implementation(project(":samples:connectivity:callnotification"))
8282
implementation(project(":samples:connectivity:telecom"))
83+
implementation(project(":samples:connectivity:UwbRanging"))
8384
implementation(project(":samples:graphics:pdf"))
8485
implementation(project(":samples:graphics:ultrahdr"))
8586
implementation(project(":samples:location"))

app/src/main/java/com/example/platform/app/ApiSurface.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ val UserInterfaceWindowManagerApiSurface = ApiSurface(
195195
null,
196196
)
197197

198+
val ConnectivityUwbRangingApiSurface = ApiSurface(
199+
"connectivity-uwb-ranging",
200+
"Connectivity UWB Ranging",
201+
null,
202+
)
203+
198204
val API_SURFACES = listOf(
199205
AccessiblityApiSurface,
200206
CameraCamera2ApiSurface,
@@ -204,6 +210,7 @@ val API_SURFACES = listOf(
204210
ConnectivityBluetoothCompanionApiSurface,
205211
ConnectivityCallNotificationApiSurface,
206212
ConnectivityTelecomApiSurface,
213+
ConnectivityUwbRangingApiSurface,
207214
GraphicsPdfApiSurface,
208215
GraphicsUltraHdrApiSurface,
209216
LocationApiSurface,

app/src/main/java/com/example/platform/app/SampleDemo.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ import com.example.platform.ui.text.LineBreak
128128
import com.example.platform.ui.text.Linkify
129129
import com.example.platform.ui.text.TextSpanFragment
130130
import com.example.platform.ui.windowmanager.demos.WindowDemosActivity
131+
import com.google.uwb.hellouwb.ui.UwbRangingActivity
131132

132133
interface SampleDemo : CatalogItem {
133134
override val id: String
@@ -367,6 +368,14 @@ val SAMPLE_DEMOS by lazy {
367368
}
368369
},
369370
),
371+
ActivitySampleDemo(
372+
id = "connectivity-uwb-ranging",
373+
name = "UWB Ranging",
374+
description = "Demonstrates how to use the UWB APIs to perform ranging.",
375+
documentation = "https://developer.android.com/guide/topics/connectivity/uwb",
376+
apiSurface = ConnectivityUwbRangingApiSurface,
377+
content = UwbRangingActivity::class.java
378+
),
370379
ComposableSampleDemo(
371380
id = "pdf-renderer",
372381
name = "PDF Renderer",

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ plugins {
1818
alias(libs.plugins.kotlin.android) apply false
1919
alias(libs.plugins.kotlin.compose) apply false
2020
alias(libs.plugins.android.library) apply false
21+
alias(libs.plugins.protobuf) apply false
2122
}

gradle/libs.versions.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,16 @@ tensorflowLiteGpuDelegatePlugin = "0.4.4"
6363
tensorflowLiteSupport = "0.4.2"
6464
barcodeScanningCommon = "17.0.0"
6565
playServicesMlkitBarcodeScanning = "18.3.1"
66+
protobuf = "0.9.4"
67+
firebaseCrashlyticsBuildtools = "3.0.5"
68+
uwb = "1.0.0-alpha10"
69+
6670

6771
[libraries]
6872
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
6973
androidx-fragment-compose = { module = "androidx.fragment:fragment-compose", version.ref = "fragmentCompose" }
7074
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navigationCompose" }
75+
androidx-uwb = { module = "androidx.core.uwb:uwb", version.ref = "uwb" }
7176
androidx-photopicker-compose = { module = "androidx.photopicker:photopicker-compose", version.ref = "photopickerCompose" }
7277
junit = { group = "junit", name = "junit", version.ref = "junit" }
7378
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
198203
tensorflow-lite-support = { module = "org.tensorflow:tensorflow-lite-support", version.ref = "tensorflowLiteSupport" }
199204
barcode-scanning-common = { group = "com.google.mlkit", name = "barcode-scanning-common", version.ref = "barcodeScanningCommon" }
200205
play-services-mlkit-barcode-scanning = { group = "com.google.android.gms", name = "play-services-mlkit-barcode-scanning", version.ref = "playServicesMlkitBarcodeScanning" }
206+
firebase-crashlytics-buildtools = { group = "com.google.firebase", name = "firebase-crashlytics-buildtools", version.ref = "firebaseCrashlyticsBuildtools" }
201207

202208
[plugins]
203209
android-application = { id = "com.android.application", version.ref = "agp" }
@@ -214,3 +220,4 @@ hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
214220
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
215221
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
216222
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
223+
protobuf = { id = "com.google.protobuf", version.ref = "protobuf" }

samples/connectivity/UwbRanging/.idea/workspace.xml

Lines changed: 249 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)