Skip to content

Latest commit

 

History

History
75 lines (47 loc) · 2.81 KB

File metadata and controls

75 lines (47 loc) · 2.81 KB

Overview

This example shows a smart watch application that looks different depending on whether the user is wearing the device on the left arm or on the right arm. The widgets are placed according to the context (here, the position of the physical buttons).

ContextSensitiveContainer is an example of a container that adapts to the context by changing how the children are laid out. In this case, the container can show two widgets (one at the center, the other on one side). Depending on the wrist mode, the side widget will be displayed on either the left or right side.

For demonstration purposes, the example displays the application in a VirtualWatchDesktop that simulates a watch device. The example can run on any target by replacing this virtual desktop with a standard desktop instead and provide a mean to change the wrist mode.

The user can flip the watch by clicking the "Flip watch" button of the virtual desktop.

Requirements

  • MICROEJ SDK 6.

  • A VEE Port that contains:

    • EDC-1.3 or higher.
    • BON-1.4 or higher.
    • MICROUI-3.4 or higher.
    • DRAWING-1.0 or higher.

This example has been tested on:

  • IntelliJ IDEA 2023.3.3.
  • STM32F7508-DK VEE Port 2.2.0.

Usage

By default, the sample will use the STM32F7508-DK VEE Port.

Refer to the Select a VEE Port documentation for more information.

Configuration

Configuration options can be found in: configuration/common.properties.

Run on simulator

In IntelliJ IDEA or Android Studio:

  • Open the Gradle tool window by clicking on the elephant icon on the right side,
  • Expand the Tasks list,
  • From the Tasks list, expand the microej list,
  • Double-click on runOnSimulator,
  • The application starts, the traces are visible in the Run view.

Alternative ways to run in simulation are described in the Run on Simulator documentation.

Run on device

Make sure to properly setup the VEE Port environment before going further. Refer to the VEE Port README for more information.

In IntelliJ IDEA or Android Studio:

  • Open the Gradle tool window by clicking on the elephant on the right side,
  • Expand the Tasks list,
  • From the Tasks list, expand the microej list,
  • Double-Click on runOnDevice.
  • The device is flashed. Use the appropriate tool to retrieve the execution traces.

Alternative ways to run on device are described in the Run on Device documentation.

Dependencies

All dependencies are retrieved transitively by gradle.

Source

N/A

Restrictions

None.


Copyright 2021-2024 MicroEJ Corp. All rights reserved.
Use of this source code is governed by a BSD-style license that can be found with this software.