Skip to content

Conversation

bobwzy
Copy link

@bobwzy bobwzy commented Aug 1, 2025


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:

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass (./gradlew --init-script gradle/spotless-init.gradle.kts spotlessApply to automatically apply formatting)

Is this your first Pull Request?

  • Run ./tools/setup.sh
  • Import the code formatting style as explained in the setup script.

Fixes #323 🦕

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Change-Id: Ib49abaaaf50a5bc30f27b90bd4302b8eb3ee65f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR]: Add Uwb Ranging demo app
1 participant