-
Notifications
You must be signed in to change notification settings - Fork 394
Add HelloUwb ranging demoapp. #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @bobwzy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces a comprehensive new sample application, 'HelloUwb', designed to demonstrate the capabilities of the AndroidX UWB Jetpack library. It's built with Jetpack Compose and is supported by a dedicated uwbranging
library module that handles UWB session management and out-of-band communication via Google Nearby Connections. The app provides practical examples for UWB ranging, device control, and data transfer.
Highlights
- New UWB Demo Application: I've added a new Android demo application named 'HelloUwb' under
samples/connectivity/UwbRanging/
. This application showcases various Ultra-wideband (UWB) capabilities using the AndroidX UWB Jetpack library. - Core UWB Ranging Library: A new reusable Kotlin library module,
uwbranging
, has been introduced. This library abstracts the complexities of UWB ranging and integrates Out-of-Band (OOB) communication using Google Nearby Connections API for device discovery and session negotiation. - Key UWB Use Cases Demonstrated: The 'HelloUwb' app includes screens to demonstrate: UWB device compatibility, device discovery, real-time distance and azimuth ranging visualization, a simulated UWB-based door lock control, and media file sharing between UWB-enabled devices.
- Persistent Settings and UI: The application uses Jetpack Compose for its UI and DataStore with Protobuf for persisting user settings, such as device role (Controller/Controlee) and UWB ranging configuration types.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds a comprehensive UWB ranging demo application. The scope of the changes is large, introducing a new Android project with multiple modules, screens, and logic for UWB communication. The implementation covers various aspects of UWB ranging, including device discovery via Nearby Connections, ranging, and data transfer.
Overall, the submission is a great starting point for a sample application. However, there are several areas that need improvement, particularly concerning Android development best practices, potential memory leaks, and UI state management bugs. I've identified a few critical and high-severity issues that should be addressed before merging.
My feedback focuses on:
- Correctness: Fixing potential crashes, memory leaks from unmanaged coroutine scopes, and UI state bugs.
- Maintainability: Removing commented-out code, improving code formatting, and clarifying implementation details.
- Best Practices: Adhering to standard Android practices for permissions, dependencies, and project configuration.
Please review the detailed comments on the specific files.
...bRanging/uwbranging/src/test/java/com/google/apps/uwbranging/impl/UwbSessionScopeImplTest.kt
Outdated
Show resolved
Hide resolved
...ctivity/UwbRanging/app/src/main/java/com/google/apps/hellouwb/ui/control/ControlViewModel.kt
Outdated
Show resolved
Hide resolved
...ctivity/UwbRanging/app/src/main/java/com/google/apps/hellouwb/ui/control/ControlViewModel.kt
Outdated
Show resolved
Hide resolved
.../connectivity/UwbRanging/app/src/main/java/com/google/apps/hellouwb/ui/home/HomeViewModel.kt
Outdated
Show resolved
Hide resolved
samples/connectivity/UwbRanging/app/src/main/java/com/google/apps/hellouwb/ui/nav/AppNavBar.kt
Outdated
Show resolved
Hide resolved
...onnectivity/UwbRanging/app/src/main/java/com/google/apps/hellouwb/ui/control/ControlRoute.kt
Outdated
Show resolved
Hide resolved
...les/connectivity/UwbRanging/app/src/main/java/com/google/apps/hellouwb/ui/home/HomeScreen.kt
Outdated
Show resolved
Hide resolved
...les/connectivity/UwbRanging/app/src/main/java/com/google/apps/hellouwb/ui/nav/AppNavGraph.kt
Outdated
Show resolved
Hide resolved
...ectivity/UwbRanging/app/src/main/java/com/google/apps/hellouwb/ui/settings/SettingsScreen.kt
Outdated
Show resolved
Hide resolved
...nectivity/UwbRanging/uwbranging/src/main/java/com/google/apps/uwbranging/impl/UwbOobEvent.kt
Outdated
Show resolved
Hide resolved
Change-Id: Ib49abaaaf50a5bc30f27b90bd4302b8eb3ee65f3
name: Pull request
about: Create a pull request
Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
./gradlew --init-script gradle/spotless-init.gradle.kts spotlessApply
to automatically apply formatting)Is this your first Pull Request?
./tools/setup.sh
Fixes #323 🦕