API reference
API reference
Select your platform
No SDKs available
No versions available

AppSystemService

AppSystemService

open class AppSystemService : VrService, AppSystemCommon, SpatialViewModelOwner
AppSystemService serves as the base class for all Spatial SDK services. It contains all Android service lifecycle callbacks: onCreate, onDestroy, and others. It also provides scene lifecycle callbacks: onSceneReady and onSceneTick. This class also provides hooks to override system features through registerSystemFeatures and to register panels through registerPanels.

Constructors

NameSummary
AppSystemService
constructor()

Types

NameSummary
Companion
object Companion

Properties

NameSummary
componentManager
val componentManager: ComponentManager
glXFManager
val glXFManager: GLXFManager
panelRegistrations
val panelRegistrations: <Error class: unknown class><Int, PanelRegistration>
registeredReceivers
var registeredReceivers: List<<Error class: unknown class>>
scene
val scene: Scene
systemManager
val systemManager: SystemManager
viewModels
open override val viewModels: MutableSet<SpatialViewModel>

Functions

NameSummary
doFrame
open fun doFrame(frameTimeNanos: Long)
findFeature
inline fun <T : SpatialFeature> findFeature(): T

fun <T : SpatialFeature> findFeature(clazz: KClass<T>): T
getComponentManager
fun getComponentManager(): ComponentManager
getDataModel
fun getDataModel(): DataModel
getSceneObject
fun getSceneObject(): Scene
getSystemManager
fun getSystemManager(): SystemManager
onBind
open fun onBind(intent: <Error class: unknown class>): <Error class: unknown class>
onCreate
open override fun onCreate()

Called when the service is first created. Override this lifecycle callback method to do all of your normal static set up: creating views, setting the content view, register Components as well as Systems and etc. You can also perform dynamic setup, such as querying for data and loading it into the view. This will also be called for all activities that are restored to their state when last paused or stopped. If you override this method, be sure to call super.onCreate().
onDestroy
open override fun onDestroy()

Called when the service is destroyed. Override this method to perform any final cleanup. If you override this method, be sure to call super.onDestroy()
onHMDMounted
open fun onHMDMounted()
onHMDUnmounted
open fun onHMDUnmounted()
onRebind
open fun onRebind(intent: <Error class: unknown class>)
onRecenter
open fun onRecenter()
onSceneReady
open override fun onSceneReady()

This hook is called on the first onResume(), after the scene is loaded in onCreate(). This is where you should call the scene APIs such as setReferenceSpace to define your scene. If you override this method, be sure to call super.onSceneReady().
onSceneTick
open override fun onSceneTick()

Called every tick in the application. It is advisable to use this lifecycle callback method sparingly and to create Systems that manage logic in every tick. If you override this method, be sure to call super.onSceneTick().
onStartCommand
open fun onStartCommand(intent: <Error class: unknown class>, flags: Int, startId: Int): Int
onUnbind
open fun onUnbind(intent: <Error class: unknown class>): Boolean
onVRPause
open fun onVRPause()
onVRReady
open fun onVRReady()
registerFeatures
open fun registerFeatures(): List<SpatialFeature>
registerMeshCreator
open fun registerMeshCreator(meshURL: String, creator: (entity: Entity) -> SceneMesh)
registerPanel
fun registerPanel(panelRegistration: PanelRegistration)

This is used to register a panel. This is called within the onCreate lifecycle for every PanelRegistration returned by registerPanels. It is strongly discouraged to call this directly to dynamically register panels, as panels should be registered during OnCreate()
registerPanels
open fun registerPanels(): List<PanelRegistration>

This hook is where you should register your panels. This is called within the onCreate lifecycle.
registerSystemFeatures
open override fun registerSystemFeatures(): List<SpatialFeature>

This hook is where the application registers SystemFeatures such as ToolkitFeature. This is called within the onCreate lifecycle. Note that to register a custom SpatialFeature, override registerFeatures instead.
runOnMainThread
fun runOnMainThread(runnable: Runnable)
setBaseHref
open fun setBaseHref(baseHref: String)
tryFindFeature
inline fun <T : SpatialFeature> tryFindFeature(): T?

fun <T : SpatialFeature> tryFindFeature(clazz: KClass<T>): T?

Companion

object Companion
Did you find this page helpful?
Thumbs up icon
Thumbs down icon