Theme
Last updated: 2026-11-10
Once the glasses are ready, your app can open an EvenHub page on the display. The display is 576 x 288 pixels. The SDK owns the page: it creates it, keeps it alive with a heartbeat every 5 seconds, matches every reply from the glasses and closes it. Your app sends page content and listens to evenHub events.
The page model is the same one Even Hub apps use. See Display & UI System for how containers, event capture and the canvas work. This page uses the Flutter API. For Kotlin and Swift, see Native Android and iOS.
Text page
For a short message, open a single text page:
dart
await sdk.openEvenHubTextPage(text: 'Hello from your app');
// Later:
await sdk.closeEvenHub();The text must be 1 to 64 bytes of UTF-8. The page receives input, and the method returns once the request is submitted. The glasses have created the page when an evenHub event arrives with phase == 'active'.
Commands
For anything larger, use executeEvenHubCommand. It waits for the glasses to answer and returns the result as a map. A command that fails throws a PlatformException.
dart
await sdk.executeEvenHubCommand(EvenHubCommand.createPage, parameters: {
'textObjects': [
{
'containerId': 1,
'containerName': 'message',
'width': 528,
'height': 240,
'xPosition': 24,
'yPosition': 24,
'isEventCapture': true,
'content': 'Hello EvenHub',
}
],
});
await sdk.executeEvenHubCommand(EvenHubCommand.updateText, parameters: {
'containerId': 1,
'containerName': 'message',
'content': 'Updated text',
});
await sdk.executeEvenHubCommand(EvenHubCommand.shutdownPage);createPage: opens a page and starts the heartbeat. Takes the page fields and an optionalwidgetId.rebuildPage: replaces the containers and menu of the open page. Takes the page fields.updateText: replaces the text of a text container. TakescontainerId,containerName,content(up to 1999 bytes) and an optionaltextColor0-4.updateImage: sends a whole image to an image container. TakescontainerId,containerName,dataandcompressMode0-2. See Images.shutdownPage: closes the page. TakesexitMode0 or 1;1asks the wearer to confirm.audioControl: turns the glasses microphone on or off. Takesenabled. See Microphone audio.imuControl: turns motion data on or off. TakesenabledandreportFrequency100-1000.menuStartupFailed: tells the glasses your app could not start from the menu. TakeserrorCodeanderrorString.menuSubitemResponse: answers a menu sub-item switch. TakesparentItemId,subItemIdandstatus.heartbeat: the SDK sends it for you.
The SDK fills in session IDs, container counts, image chunking and heartbeat counters. Passing any of them, or any unknown key, is rejected.
Page fields
createPage and rebuildPage take these lists, with at most 12 containers in total:
| Field | Up to | Each item |
|---|---|---|
textObjects | 8 | Container fields plus content (up to 999 bytes) and textColor 0-4 |
listObjects | 4 | Container fields plus itemContainer: itemNames (1-20 items, up to 63 bytes each), itemWidth, isItemSelectBorderEnabled |
imageObjects | 4 | Container fields; width 20-288 and height 20-144 |
menu | 1 | items: 1-10 menu items |
Every container takes:
| Field | Value |
|---|---|
containerId | Required, a non-zero number unique across the page |
containerName | Required, 1-15 bytes |
width, height | Required, 1-576 and 1-288 |
xPosition, yPosition | 0-576 and 0-288, default 0 |
zOrderIndex | Optional |
borderWidth 0-5, borderColor 0-15, borderRadius 0-10, paddingLength 0-32 | Text and list containers, default 0 |
isEventCapture | Text and list containers; at most one per page |
A menu item has itemName (1-31 bytes), a non-zero itemId, position 0-10, checkedIndex and up to 5 subItems, each with its own itemName and itemId.
Images
updateImage takes the whole image as data, up to 1 MB, already encoded in the glasses' image format for the compressMode you pass. The SDK splits it into chunks and confirms each one. It does not convert PNG or BMP files.
Microphone audio
After both sides are ready and the page is active, turn on the glasses microphone:
dart
await sdk.executeEvenHubCommand(EvenHubCommand.audioControl, parameters: {'enabled': true});Audio starts once the firmware acknowledges the command. At least one connected side must support the glasses' audio stream. The audio arrives as evenHub events with event == 'audioEvent':
audioPcm: the audio as aUint8List, decoded by the native SDK into signed 16-bit little-endian PCM.sampleRate16000,channels1 andbitsPerSample16.source:glasses.speakerRole:self,otherorunknown.direction: a signed number, when the firmware provides one.
Turn the microphone off with {'enabled': false}. Closing the page or disconnecting also stops the audio.
Closing a page
shutdownPage with exitMode: 0, or closeEvenHub(), closes the page at once. With exitMode: 1 the glasses ask the wearer to confirm: the result carries awaitingExit: true, and the page stays open until the wearer exits.
Menu replies
When the wearer switches a menu sub-item, answer with menuSubitemResponse within 10 seconds. menuStartupFailed works as soon as the glasses are ready, with or without a page. Both complete once the SDK has queued them; the glasses do not acknowledge them.
Page events
evenHub events report the page in phase:
phase | Meaning |
|---|---|
opening | Page requested |
active | The glasses created the page |
heartbeat | The glasses confirmed a heartbeat; heartbeatCount counts them |
input | The wearer did something; the action is in event |
closing | Close requested |
closed | The page is closed |
failed | The page failed; the reason is in failure |
A failure of busy means the SDK did not accept the request. The page that was already open stays open.
Input in event:
event | Wearer action |
|---|---|
click, doubleClick | Tap or double tap |
scrollUp, scrollDown | Swipe |
longPress, longPressRelease | Long press starts and ends |
foregroundEnter, foregroundExit | The page comes to the front or leaves it |
exit, abnormalExit | The page exits |
details carries the rest: kind (list, text or system), the containerId and containerName of the container that received the input, selectedItemName and selectedItemIndex for lists, source (leftGlasses, rightGlasses or ring) for system input, x, y and z for motion data, and the item IDs for menu clicks and sub-item switches.