Develop
Develop
Select your platform

Space Sharing Sample App

Updated: Feb 16, 2025
The Mobile OpenXR SDK includes a complete example of how you can integrate Space Sharing provided by the SDK. The sample app is under XrSamples/XrSceneSharing.

What’s Included

The sample app showcases how Space Sharing can be used together Group Sharing API and Scene API to:
  • How to share captured space - walls, ceiling, floor and furniture from a host device to a group
  • How to retrieve the shared space - walls, ceiling, floor and furnitures from a group on guest devices
  • How to render the shared space in a common coordinated frame between host and guest devices for colocated experience

How To Use the Sample

In the sample app, group UUID is shared between host and guest devices via a file, which involves some manual steps to copy the file from host device to guest device.

On host device

  • Capture a space using Space Setup before starting the app. If no space is captured, the app will auto trigger Space Setup upon launch.
  • Press button A to query the captured space, the space will be rendered in pasthrough
  • Press button B to share the space, wait for about 10s for the space to be shared. Upon successful sharing, a group UUID will be saved in the folder of /sdcard/Android/data/com.oculus.sdk.scenesharing/files/sharedGroupUuid.txt
  • Examine the file to check that the group uuid is saved to the file. The file can be copied over to a guest device, so the app on guest can load the group Uuid

On guest device

  • Copy the sharedGroupUuid.txt that contains the groupUuid from the host device to the same directory on the guest using adb shell push
  • Alternatively, can manually create the file and copy the group Uuid to the file by running (this is four commands in one, using ;): adb shell mkdir -p /sdcard/Android/data/com.oculus.sdk.scenesharing/files/ ; adb shell touch /sdcard/Android/data/com.oculus.sdk.scenesharing/files/sharedGroupUuid.txt ; adb shell echo “7E5F216B77219C74ED3D8A46DFE59A07>/sdcard/Android/data/com.oculus.sdk.scenesharing/files/sharedGroupUuid.txt” ; adb shell chmod +r /sdcard/Android/data/com.oculus.sdk.scenesharing/files/sharedGroupUuid.txt Note in the above example, 7E5F216B77219C74ED3D8A46DFE59A07 is the group uuid saved in the host’s sharedGroupUuid.txt
  • Verify that the above file is created and the groupUuid is written to the file
  • Start the app
  • Press button X, wait for some time for the shared space to be downloaded, and verify that the shared space can all be loaded and rendered on the guest device.

Launching the Sample

To try this out, install the sample app under ‘XrSceneSharing/Projects/Android’ onto the Meta Quest device. For instructions on launching samples, refer to the ‘README.md’ located at ‘XrSamples/README.md’ in the OpenXR Mobile SDK.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon