- 09 Jan 2024
- 3 Minutes to read
- Contributors
- Print
- DarkLight
Display Process
- Updated on 09 Jan 2024
- 3 Minutes to read
- Contributors
- Print
- DarkLight
Check Connected Status
The first step is to determine if glasses are connected. On Android and iOS, this is a simple check via the SDK.
On iOS, each app must link to the glasses once, or the connected state will never become true. So, on iOS you must initiate the SDK calls to link the glasses. This is likely initiated from a settings menu, or an options menu. The SDK provides a Picker user interface to handle this process for you, or the underlying SDK scanning and linking calls can be added to your own UI. Once the iOS app has linked to the glasses once, the connected state of the glasses will be tracked as the glasses are connected and disconnected.
Request Control
Once your app determines the glasses are connected, your software can request control and set the layout type. The control is always given to the last one to request it. The layout type determines which calls to use to send content to the glasses.
The most flexible layout type is the “canvas” layout. In this layout you may place up to seven text boxes, three images, one animation, and a full-screen background layer.
Populate the Layout
Text
The 7 text boxes on the canvas layout each have explicit coordinates, box size, text alignment, and text wrapping options. Each text box must first be created which provides a unique integer handle for use later. Once a text box is created, the text in it may be updated, moved, hidden, and shown again.
Foreground Images
The canvas layout also allows up to three foreground images available. These also must be created on the canvas by providing the image source and the position coordinates. If the image is not at the desired size, it should be resized in memory before being sent to the SDK. Once images are created, they can be updated, moved, hidden, and shown, similar to text boxes.
The foreground images are limited in size, and are not intended to fill the entire screen, but rather provide icons. They should be less than 100x100 pixels.
Animation
Two or three of foreground images may be combined into a single simple animation that will play in a loop. These use the two or three of the available image objects. The duration of the loop is set, and each image is shown for a portion of that total duration (either half the duration if there are two images, or one third the duration if there are three images).
Canvas Background
The canvas also has a background layer that is the full 640x480 pixels of the screen.
The entire background, or any rectangle within it, may be set to a solid color or set to transparent by clearing it.
The background may also contain images. There is no limit to the complexity of the content that can be placed in the background. It can even be set to a full-screen photo; however, it may take a few seconds to transfer.
Whenever a foreground text, image, or animation is shown, it will cover the background. As foreground objects are moved or hidden, the background is restored.
Foreground vs Background Considerations
Anything that could be sent in the foreground could also be rendered to a flat 640x480 image by the phone and sent as a background image. Rendering the image yourself gives you complete control of all visual rendering, and is useful when the available command set does not produce the desired result.
However, sending large bitmaps is often slower than sending text. In systems where responsiveness is critical, it is best to send the text as foreground text objects. This is also useful in situations where the text might be shown and hidden frequently.
Often it is best to use a combined approach where static text labels are part of the background, and dynamic text is sent in foreground text objects.
Animations will always play smoothly when sent as a foreground animations, and would have worse performance if you animate by quickly changing the background image.
Release Control
Once your application is done, you may release control. This will put it back into a mode that shows phone notifications as full-screen pop-ups. If you fail to release control, the glasses screen may stay on with stagnant information once you are finished rendering.