Skip to content

Commit 32c179b

Browse files
committed
Update documentation to the latest state of the development
1 parent e28cd9e commit 32c179b

6 files changed

Lines changed: 467 additions & 53 deletions

File tree

docs/android/architecture.md

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -87,53 +87,6 @@ The automotive application reuses the sources of the `:app` module, simplifying
8787

8888
The Wear OS app communicates with the mobile app to retrieve credentials for the Home Assistant server and other configurations using the [Messaging API](https://developer.android.com/training/wearables/data/messages). It only works with the `full` flavor, as it requires Google Play Services. Once the initial setup is complete, all further communication is handled directly with Home Assistant through the WebSocket and the [webhook](/docs/api/native-app-integration/sending-data) that is created for the app.
8989

90-
## WebView communication architecture
90+
## Frontend communication
9191

92-
The Android app's WebView acts as a bridge between the Home Assistant frontend and native Android capabilities. This architecture enables [external authentication](docs/frontend/external-authentication.md) and [external bus](/docs/frontend/external-bus) messaging between the frontend and native code.
93-
94-
### Architecture overview
95-
96-
```mermaid
97-
flowchart TB
98-
subgraph WebView
99-
JS[Home Assistant Frontend JS]
100-
end
101-
102-
subgraph Bridge
103-
JsBridge[FrontendJsBridge]
104-
end
105-
106-
subgraph Handler
107-
MsgHandler[FrontendMessageHandler]
108-
end
109-
110-
subgraph Repositories
111-
ExternalBusRepo[FrontendExternalBusRepository]
112-
SessionMgr[ServerSessionManager]
113-
end
114-
115-
JS -->|"getExternalAuth()"| JsBridge
116-
JS -->|"revokeExternalAuth()"| JsBridge
117-
JS -->|"externalBus()"| JsBridge
118-
119-
JsBridge -->|"FrontendJsHandler"| MsgHandler
120-
121-
MsgHandler -->|"onMessageReceived()"| ExternalBusRepo
122-
MsgHandler -->|"getExternalAuth()"| SessionMgr
123-
MsgHandler -->|"revokeExternalAuth()"| SessionMgr
124-
125-
SessionMgr -->|"ExternalAuthResult"| MsgHandler
126-
SessionMgr -->|"RevokeAuthResult"| MsgHandler
127-
ExternalBusRepo -->|"incomingMessages()"| MsgHandler
128-
MsgHandler -->|"send()"| ExternalBusRepo
129-
130-
ExternalBusRepo -->|"scriptsToEvaluate()"| JS
131-
MsgHandler -->|"evaluateScript()"| ExternalBusRepo
132-
```
133-
134-
### Component responsibilities
135-
136-
- **FrontendJsBridge**: JavaScript interface exposed to the WebView that receives calls from the frontend
137-
- **FrontendMessageHandler**: Central message handler that routes requests between the frontend and native components
138-
- **FrontendExternalBusRepository**: Manages bidirectional message passing for the external bus protocol, parsing JSON messages into strongly-typed data structures
139-
- **ServerSessionManager**: Handles authentication token management for external authentication
92+
The dashboard is the Home Assistant frontend rendered inside a [WebView](https://developer.android.com/reference/android/webkit/WebView), which the app talks to over [external authentication](/docs/frontend/external-authentication) and the [external bus](/docs/frontend/external-bus). The screen that hosts it — its MVI‑like structure, the JavaScript bridge, the message flow, and the V1/V2 protocols — is documented in [UI architecture (MVI‑like)](/docs/android/ui_architecture#frontend--native-communication).

0 commit comments

Comments
 (0)