Architecture
A VEE Wear device runs the Wear Kernel and a set of sandboxed applications.
The Wear Kernel is the firmware that runs on the watch and hosts the applications.
The Wear Services library is the API between the applications and the Kernel.
The Wear Util library gives helper classes to implement the application components.
An application adds watchfaces, activities, complication data sources, or the navigation of the watch.
Note
The source code of the Wear Kernel is available on demand. Contact MicroEJ Support to evaluate VEE Wear.
VEE Wear Kernel
The Wear Kernel is the first application that starts at boot. It stays active while the device runs and does the following:
It installs, starts, stops, and uninstalls the applications.
It implements the Wear Services and gives the applications access to them.
It keeps the list of the watchfaces, activities, and complication data sources that the applications register.
It receives new applications from the smartphone over Bluetooth Low Energy.
Each application is isolated from the other applications and from the Kernel (see Kernel & Features Specification (KF)). The Kernel can stop or uninstall a failing application at any time, and the other applications and the watch keep running.
The applications can be included in the firmware at build time, or installed later while the device runs. A device maker can then add features and fixes to a watch already in the field, without a firmware update.
The Kernel does not depend on a specific board. To port VEE Wear to new hardware, build the Kernel with the VEE Port of this hardware. The build produces the firmware executable and a Virtual Device. Application developers use the Virtual Device to build and test their applications on the Simulator.
The Kernel provides the following Foundation Libraries to the applications:
Library |
Version |
|---|---|
EDC |
|
BON |
|
KF |
|
Trace |
|
FS |
|
MicroUI |
|
Drawing |
|
MicroVG |
|
Bluetooth |
The Kernel also provides the MWT 3.6 and Transformed Image Painter 2.0 libraries. Applications use them without including their own copy.
VEE Wear Services Library
The Wear Services library is the API between the applications and the Kernel. The Kernel implements the services, and the applications call them. The applications implement the components, and the Kernel calls them.
The library contains only the API. The Kernel provides the implementation at runtime. The library depends on the EDC, BON, MicroUI, MicroVG, and FS Foundation Libraries.
KernelServiceProvider returns the instance of each service, for example KernelServiceProvider.getTimeService().
It also returns a shared Timer, so that an application can schedule tasks without creating a thread.
The Services chapter describes each service.
To use the Wear Services library, add this dependency to the build.gradle.kts file:
implementation("com.microej.library.wear:wear-services:2.0.0")
Components
The applications implement the following components:
Component |
Role |
|---|---|
Shows the time and other data. Listed in the watchface picker, with its preview. |
|
Shows a page for one feature of the watch. Listed in the activity launcher, with its name and its icon. |
|
Gives a text, an icon, or a progress value (from 0.0 to 1.0) that any watchface can show. |
|
Draws the page of an activity or a watchface. |
|
Handles the user gestures and decides which page to show. |
|
Receives the new time, time zone ID, and UTC offset when the time configuration changes. |
Component Lifecycle
An application registers its components with the ComponentService, in its entry point.
After that, the Kernel calls the component methods when the user navigates on the watch.
The Kernel calls the methods of a Renderable in this order:
onAttached(), one time: the renderable loads its resources.render(), any number of times, for example during a transition between two pages.showOnDisplay(), at most one time, when the page becomes the fullscreen page.onDetached(), one time: the renderable releases its resources.
Icons and watchface previews use the same pattern, with onIconAttached() / onIconDetached() and onPreviewAttached() / onPreviewDetached().
An application keeps its images in memory only while the Kernel shows them.
