L'SDK Android XR è ora disponibile in Anteprima per gli sviluppatori. Vorremmo sapere cosa ne pensi. Per contattarci, visita la nostra pagina di assistenza.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Un utente può utilizzare la tua app in due modalità: Spazio della casa o Spazio completo. In Home
Space, un utente può eseguire il multitasking con la tua app in esecuzione affiancata ad altre
app. In Full Space, la tua app è al centro dell'esperienza dell'utente
e ha accesso completo alle funzionalità immersive di Android XR.
L'app si apre in Home Space per impostazione predefinita, a meno che tu non specifichi diversamente come
descritto nella sezione Dichiarare la modalità di avvio predefinita.
La spatializzazione è supportata solo in Full Space. La tua app può passare a
Full Space per sfruttare le funzionalità spaziali e 3D. Quando l'app è
in primo piano, puoi passare da una modalità all'altra richiedendo lo
spazio corrispondente.
Transizione tra lo spazio Home e lo spazio intero
Se utilizzi la libreria Jetpack Compose per XR, richiedi lo spazio della casa o lo spazio completo
utilizzando la composizione locale LocalSpatialConfiguration.
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-08-28 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-28 UTC."],[],[],null,["# Transition from Home Space to Full Space\n\nA user can experience your app in two modes, Home Space or Full Space. In Home\nSpace, a user is able to multitask with your app running side by side with other\napps. In Full Space, your app takes center stage as the focus of the user's\nexperience with full access to the immersive capabilities of Android XR.\n\nYour app opens in Home Space by default unless you specify otherwise as\ndescribed in the [Declare the default mode for launch](#declare-default-mode) section.\n\n[Spatialization](/design/ui/xr/guides/foundations) is only supported in Full Space. Your app can transition to\nFull Space to take advantage of spatial and 3D capabilities. When your app has\nfocus, you can transition between these modes by requesting the corresponding\nspace.\n\nTransition between Home Space and Full Space\n--------------------------------------------\n\nIf you are using the Jetpack Compose for XR library, request home space or full\nspace using the [`LocalSpatialConfiguration`](/reference/kotlin/androidx/xr/compose/platform/package-summary#LocalSpatialConfiguration()) composition local.\n\n\n```kotlin\nLocalSpatialConfiguration.current.requestHomeSpaceMode()\n// or\nLocalSpatialConfiguration.current.requestFullSpaceMode()https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/xr/src/main/java/com/example/xr/misc/ModeTransition.kt#L27-L29\n```\n\n\u003cbr /\u003e\n\nIf you are using the Jetpack SceneCore library, you can request the\ncorresponding space from the [`Session`](/reference/kotlin/androidx/xr/runtime/Session); see [Access Session from Jetpack\nSceneCore](/develop/xr/jetpack-xr-sdk/add-session#access-session).\n\n\n```kotlin\nxrSession.scene.requestHomeSpaceMode()https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/xr/src/main/java/com/example/xr/misc/ModeTransition.kt#L35-L35\n```\n\n\u003cbr /\u003e\n\nSee the [Learn Android XR Fundamentals: Part 1 - Modes and Spatial Panels](/codelabs/xr-fundamentals-part-1#5)\ncodelab for examples of how to use these requests to transition between modes by\nclicking a button. We also recommend reviewing our [design guidance](/design/ui/xr/guides/foundations) to learn\nmore about Home Space to Full Space and how to best transition between the two.\n\nDeclare the default mode for launch\n-----------------------------------\n\nAlternatively, you can add the following lines to your Android Manifest file to\nchoose which space your app should open in: \n\n \u003c!-- Launch in Full Space. --\u003e\n \u003cproperty\n android:name=\"android.window.PROPERTY_XR_ACTIVITY_START_MODE\"\n android:value=\"XR_ACTIVITY_START_MODE_FULL_SPACE_MANAGED\" /\u003e\n\n \u003c!-- Or, launch in Home Space. --\u003e\n \u003cproperty\n android:name=\"android.window.PROPERTY_XR_ACTIVITY_START_MODE\"\n android:value=\"XR_ACTIVITY_START_MODE_HOME_SPACE_MANAGED\" /\u003e\n\n| **Note:** These manifest attributes can be declared at either the `\u003cactivity\u003e` or the `\u003capplication\u003e` level in your app's manifest. Declaring at the activity level will impact the launch preference for the activity element you apply it to.\n\nSee also\n--------\n\n- [Check for spatial capabilities](/develop/xr/jetpack-xr-sdk/check-spatial-capabilities)\n- [Create a session](/develop/xr/jetpack-xr-sdk/add-session)\n- [Add environments to your app](/develop/xr/jetpack-xr-sdk/add-environments)\n- [Add 3D models to your app](/develop/xr/jetpack-xr-sdk/add-3d-models)"]]