Android host API
Quick reference
| API | Behavior |
|---|---|
ReloUI() | Convenience runtime over the View renderer. |
RemoteDocument(source, data, format) | Create source + data; defaults empty data, format 1. |
runtime.session(document) | Validate and create RemoteSession. |
runtime.action(name, action) | Register a suspend host operation; typed registration is also available. |
runtime.binding(name, binding) | Register a host-owned observable binding. |
RemoteView.attach(session, owner, sizing) | Attach a View to an Android lifecycle owner. |
runtime.component(name, serializer, validate) | Register decoded native props. Attach a View adapter and declare events or commands before creating a session. |
runtime.navigation | Set the host router and optional route support check. |
view.theme / view.imageLoader | Set appearance overrides or a host image loader. |
view.detach() | Release this native attachment. |
session.updateData(data) | Replace root data, preserving compatible instances. |
session.reset(data) | Reset local state within the document. |
session.replace(document) | Explicit document replacement. |
session.close() | Release logical state and cancel pending work. |
Minimal host
import com.relo_ui.ReloUI
import com.relo_ui.core.RemoteDocument
val runtime = ReloUI()
val session = runtime.session(RemoteDocument("<Text text=\"Hello\" />"))
// Attach RemoteView with the Fragment viewLifecycleOwner.
// Close when its logical destination is permanently removed:
session.close()
Ownership and platform requirements
Keep minSdk 24, compileSdk 36, JDK 17, and JVM target 11. relo-core is platform-free; relo-views renders Views; relo-ui provides convenience APIs. Compose hosts RemoteView through
AndroidView as shown in the smoke app. The relo-compose module is a scaffold. Retain logical sessions separately from Fragment view lifecycles.
Register actions, bindings, navigation, and native adapters before creating sessions. Session registrations are snapshotted. The app owns authentication, persistence, transport, and fallback UI. XML component definitions still need assembly even when Components host services are installed.
Android integration guide · Current source · Document contract