Files
nearby/sharing/android/example
Nick Bourdakos a08a42077c PR #2404: Add license header to all source files
Imported from GitHub PR https://github.com/google/nearby/pull/2404

Copybara import of the project:

--
a6fbb3c396321c0b9012b787323f5f2ff652fd8f by Nick Bourdakos <bourdakos1@gmail.com>:

Add license header to all source files

Merging this change closes #2404

PiperOrigin-RevId: 623540004
2024-04-10 10:40:38 -07:00
..
2024-01-10 15:25:20 -08:00
2024-01-10 15:25:19 -08:00
2024-04-01 19:01:59 -07:00
2024-01-10 15:25:20 -08:00
2024-04-01 19:01:59 -07:00

Nearby Share sample app

This app is a demonstration of how to bind to and use the Nearby Share slice.

Build instructions

From the root of the repository:

// Run this before importing into Android Studio!
$ cd sharing/android/example
$ gradle wrapper
$ ./gradlew build

For the gradle wrapper, we recommend Gradle 8.0+.

Key callouts

MainViewModel - contains the business logic for processing and binding to the slice, as well as the lifecycle of the slice.

MainActivity - hosts the MainView composable and provides the intent to fill in the slice's PendingIntent action with, providing the data to send via Nearby Share.

Screenshots

No devices available screenshot Devices available screenshot Consent prompt screenshot