Build Your First MicroEJ Firmware

An example on how-to build a minimal MicroEJ Multi-App Firmware.
EXAMPLE for MISC
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
5 September 2017
<!--
	Markdown
	Copyright 2017 IS2T. All rights reserved.
	Use of this source code is subject to license terms.
-->

# Overview

This repository provides an example of a minimal MicroEJ Multi-App Firmware that features:
* a default implementation of the Wadapps framework.
* an administration server for managing the applications lifecycle (INSTALL, START, STOP, UNINSTALL).
* the exposure of a set of default APIs for applications (`EDC` + a communication channel - `NET` or `ECOM-COMM`).
* the virtual device configuration including Applications Local Deployment and Wadapps Administration Console tools.

The minimal Multi-App Firmware is declined into two distinct projects, depending on the communication channel used by the administration server:
* `com.microej.example.firmware.minimal.comm`: communication over TCP/IP network (`NET` API).
* `com.microej.example.firmware.minimal.net`: communication over a serial link (`ECOM-COMM` API).

The minimal Multi-App Firmware is headless, meaning it does not expose nor use user interfaces (such as GUI, buttons, ...). It is an entry point for developers that want, in only few steps, build their first Multi-App Firmware and test deploying an application on it.

# Requirements

* MicroEJ SDK 4.1.1 or higher.
* A MicroEJ 4.1 Multi-App platform (binary) imported into the MicroEJ repository. Please consult (<http://developer.microej.com>) for a list available evaluation platforms.
* An activated Evaluation or Production license.
* For `NET` example, a board connected to the same sub-network than the PC.
* For `COMM` example, a board with a USB-TTL cable plugged to the PC and connected to RX/TX pins.

# Dependencies

All dependencies are retrieved from _MicroEJ Central Repository 4.1_ (<http://developer.microej.com/ivy/4.1/>) using Apache Ivy. Those dependencies include:
* A set of foundation libraries, required for any Multi-App Firmware (such as `EDC` and `KF` libraries).
* A foundation library specific to each project, depending on the administration server back-end (`NET` or `ECOM-COMM`).
* Wadapps add-on libraries (_Wadapps Application Framework_, _Storage_ back-ends, ...).
* A firmware bootstrap library, that simplifies firmware development.
* A set of APIs exposed to applications.
* A set of Resident Applications, that are linked together with the Kernel to produce the Multi-App Firmware.
* A set of Virtual Device tools, such as Local Deployment and Wadapps Administration Console.

# Usage

## Import Firmware Projects

Start MicroEJ SDK on an empty workspace and clone this Git repository (`File > Import > Git > Projects From Git`).

At the end of the process, two projects have been imported:
  * `com.microej.example.firmware.minimal.net`
  * `com.microej.example.firmware.minimal.comm`

In the rest of the document, the term `[backend]` has to be replaced with either `net` or `comm` depending on the chosen firmware project.

## Select and Configure the Firmware

In case of the `net` back-end, the project is already configured.

In case of the `comm` back-end, the COM port on which the administration server will be connected must be set. Please consult the documentation of the selected platform to get the list of available platform COM ports. Edit `com.microej.example.firmware.minimal.comm/build/common.properties` and update with the appropriate value:

    ej.ecom.com.0.port=[PLATFORM_COM_VALUE]

## Setup a Platform

Before building the firmware, a target platform must be configured in the MicroEJ workspace.

* Go to `Window > Preferences > MicroEJ > Platforms` and put the mouse pointer over the desired platform.
* A tooltip with some information should appear. Press `F2` to show more information.
* Select the the platform _Path_ and copy it to the clipboard.
* Go to `Window > Preferences > Ant > Runtime` and select the `Properties` tab.
* Click on `Add Property...` button and set a new property named `platform-loader.target.platform.dir` with the platform path pasted from the clipboard.

There are other ways to setup the input platform for building the firmware. Please consult the _Multi-App Firmware Developer's Guide_ for more informations.

## Build the Firmware

* Right-click on the chosen firmware project and select `Build With EasyAnt`. This may take several minutes.

After successful build, the firmware artifacts are available in firmware project build folder `target~/artifacts` and contains:
* the firmware executable file (`minimal.[backend].out`).
* the corresponding virtual device (`minimal.[backend].jpf`).
* the firmware package for the MicroEJ Store (`minimal.[backend].kpk`)

## Program the Firmware on the Device

The procedure to program a firmware is platform specific. Please refer to the platform documentation for the detailed firmware flashing procedure.

To flash the firmware, open `Run Configurations` menu, then create a `MicroEJ Tool` run configuration named `Flash Firmware`.
* In `Execution` tab:
	* In `Target Platform`, select the platform used to build the firmware,
	* In `Settings`, select `Program with [Flasher Tool]` (e.g `ST Link` or `Segger J-Link`),
	* Set `Output Folder` to firmware project folder.
* In `Configuration` tab:
	* Set the application binary file to `target~/artifacts/minimal-[backend].out` file.
* Click on `Run` and wait until the flashing procedure is terminated.

# Develop and Deploy an Application

Prior to develop an application, the virtual device has to be imported:

* Go to `File > Import > MicroEJ > Platforms, Virtual Devices and Architectures`
* Browse the file `\target~\artifacts\minimal.[backend].jpf` and put the mouse pointer over the desired platform.

Note that the application development can be done in a dedicated MicroEJ Studio instance (the virtual device can be freely distributed).

To create and deploy a basic application, please refer to the _Sandboxed Application Developer's Guide_ (sections _Background Service Application_ and _Wadapps Administration Console_).


# Additional Resources

## Developer Web Site

MicroEJ developer web site (<http://developer.microej.com>) is the entry point to find examples, tools and documentation.

Specifically, foundation libraries javadoc can be found at <http://developer.microej.com/javadoc/microej_4.1/foundation/>, and addon libraries (such as _Wadapps Application Framework_) javadoc can be found at <http://developer.microej.com/javadoc/microej_4.1/addons/>.

## License

Examples are subject to license agreement. See `LICENSE.txt` in firmware projects.

## Change Log

Please consult `CHANGELOG.md` in firmware projects for the firmware content versioning.

### 1.0.0 (June 1st, 2017)

Features:
* Initial public revision for MicroEJ 4.1.

JUnit Example (Sandboxed)

This project gathers simple sandboxed applications tested with JUnit.
EXAMPLE for MISC
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio
Last updated:
29 August 2017
# Overview

This project gathers simple sandboxed applications tested with JUnit.

# Requirements

* MicroEJ Studio or SDK 4.1 or later

# Usage

Each subfolder contains a distinct application.

# Changes

* See the change log file [CHANGELOG.md](CHANGELOG.md) located at the root of this repository.

# License

* See the license file [LICENSE.txt](LICENSE.txt) located at the root of this repository.

Using IOT Libraries APIs (Sandboxed)

This project gathers simple Sandboxed application using net libraries.
EXAMPLE for IOT
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
29 August 2017
# Overview
This project gathers simple sandboxed applications using net libraries.

## Requirements
* MicroEJ Studio or SDK 4.1 or later

# Usage
Each subfolder contains a distinct IOT application.

# Changes
- See the change log file [CHANGELOG.md](CHANGELOG.md) located at the root of this repository.

# License
- See the license file [LICENSE.md](LICENSE.md) located at the root of this repository.

Resources in External MCU Memories

Example that shows how to store resources in external non-byte addressable memories.
EXAMPLE for MISC
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
29 August 2017
# Overview
The following project illustrates the MicroEJ external resource loader feature (used for resources stored on non-byte-addressable memories).

## ExternalImages
This example displays images supposed to be in the external resources.

### Requirements
- MicroEJ 4.1 or later.
- Java platform with (at least) EDC-1.2.3, MICROUI-2.0.6, BON-1.2.4 and containing the module `External Resources Loader`.

### Project structure
- `src/main/java`
     - Java sources
- `src/main/resources`
     - Images supposed to be in the external resources.
- `src/main/c`
    - C sources

## Running the application on simulator
Using MicroEJ, you may deploy and run your application on an embedded target (if the hardware and related BSP are available) or you may run your application on a Java simulator mimicking the behavior of your embedded target.

## Building for the simulator

* Select **Run > Run Configurations...** menu item
* Select **MicroEJ Application** group
* Create a new configuration:
    * In **Project** field, Click the **Browse** button and select **Example-ExternalResourceLoader**
	* In **Execution** tab
		* In **Target** frame
			* Click the **Browse** button next to the JPF Field and select your platform
		* In **Execution** frame
			* Notice that "Execute on SimJPF" radio button option is checked
	* Click on "Run"
	
## Running the application on target

### Building for the target

* Select **Run > Run Configurations...** menu item
* Select **MicroEJ Application** group
* Create a new configuration:
    * In **Project** field, Click the **Browse** button and select **Example-ExternalResourceLoader**
	* In **Execution** tab
		* In **Target** frame
			* Click the **Browse** button next to the JPF Field and select your platform
		* In **Execution** frame
			* Notice that "Execute on EmbJPF" radio button option is checked
	* Click on "Run"

### Opening the generated C project (BSP specific)
* From the **Project Explorer** view
	* Navigate to the [**-bsp/Project/MicroEJ/MDK-ARM](**-bsp/Project/MicroEJ/MDK-ARM) folder
	* Double-click on the [Project.uvproj](C**-bsp/Project/MicroEJ/MDK-ARM/Project.uvproj) file (this will open the BSP project in the MicroVision IDE)

### Linking (BSP specific)
* From the MicroVision IDE
	* Select **Project > Build Target** menu item (or press F7 keyboard shortcut)

### Flashing the board (BSP specific)
* Connect your board
* Select **Flash > Download** menu item (or press F8 keyboard shortcut).

## LLEXT implementations

### LLEXT_static_array.c
This file should be part of a MICROEJ -bsp project and is the low level driver for the external resource module.
This implementation simply stores the images in a static array (as PNG encoded).
You can also use decoded images (bitmap) generated by the image generator in MicroEJ.

## Changes
- First release: ExternalImages example and LLEXT_static_array.c.

## License
See the license file `LICENSE.md` located at the root of this repository.

Examples Eclasspath

This project gather all the examples of eclasspath.
EXAMPLE for MISC
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
29 August 2017
# Overview

This project gather all the examples of eclasspath. Eclasspath contains Java runtime libraries.

Note that to run them on board:

* If you are using MicroEJ SDK:
 * You need a supported board (see http://developer.microej.com/index.php?resource=JPF for a list of supported boards using MicroEJ SDK evaluation version)
 * And the associated platform binary .jpf file (retrieve it from the previous link and import it into MicroEJ SDK)

* If you are using MicroEJ Studio:
 * You need to convert them from standalone applications to sandboxed applications.
 * Follow the [How-To convert a standalone app into a sandboxed app](https://github.com/MicroEJ/How-To/tree/master/StandaloneToSandboxed) guide.
 
# Details
## logging
**Available Examples**:
* [com.microej.examples.eclasspath.logging](com.microej.examples.eclasspath.logging) : Writes in the logger.

Using SNI and SP Libraries API (Standalone)

This repository contains examples showing how to enable communication between programs written in C and programs written in Java using MicroEJ APIs.
EXAMPLE for MISC
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
29 August 2017
[](Markdown)
[](Copyright 2016 IS2T. All rights reserved.)
[](IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.)
# Overview

Although MicroEJ lets you leverage Java in an embedded context, there are still some cases where your Java threads need to synchronize and exchange data with OS tasks written in C/C++.

This repository contains examples showing how to enable communication between programs written in C and programs written in Java using MicroEJ APIs.

## Available examples

For calling C functions from a Java class, MicroEJ provides the SNI API. The following examples illustrate how to use this API :
* [CallingCFromJava](/CallingCFromJava) provides an example of invocation of a C function from a Java method
* [CallingCFromJava](/CallingCFromJavaMock) is a helper project required in order to be able to run the Java application on simulator

The SNI library also provides APIs for tasks/threads synchronisation via function calls and callbacks.

For data exchange issues between tasks/threads, MicroEJ provides a few options:
* Shielded Plug API (suitable for sharing structured data, with built-in wait/release synchronisation APIs)
* Immortals API and SNI API (suitable for sharing access to raw data, but you need to provide your own synchronisation mechanism)

The following examples, based on the consumer/producer problem, illustrate how to use those APIs :

* [Producer Consumer with ShieldedPlug](/ProducerConsumerUsingShieldedPlug) using Shielded Plug API as the delivery mechanism
* [Producer Consumer with SNI and Immortals](/ProducerConsumerUsingQueues) using SNI and Immortals APIs to wrap the native FreeRTOS message queue API as the underlying delivery mechanism

Each example comes with a launch configuration. These launch configurations require that the target platform (common to each configuration) is built.

# Building the Java Platform (JPF)

We need to generate and build a Java Platform (JPF), i.e. the set of object files and libraries required to execute Java code on the target platform linked by an executable C program.

The following assumes that you have downloaded and imported the STM32F646-DISCO platform from [MicroEJ SDK Getting Started](http://developer.microej.com/getting-startetd-sdk.html) web page.

### Creation

* Select **File > New > Other... > MicroEJ > Platform** menu item
	* Click **Browse** button next to the **Architecture** field and select **STMicroElectronics STM32F7J ARMCC**
	* Check the **Create from a platform reference implementation** option
		* Select **STM32F746-Disco > Standalone**
	* Click **Next**
		* Set the name field to "**SNI**"
		* Set the version field to "**1.0.0**"
	* Click **Finish**. This will lead to the generation of a few projects in our workspace :
		* [STM32F746GDISCO-SNI-CM7hardfp_ARMCC5-bsp](STM32F746GDISCO-SNI-CM7hardfp_ARMCC5-bsp)
		* [STM32F746GDISCO-SNI-CM7hardfp_ARMCC5-configuration](STM32F746GDISCO-SNI-CM7hardfp_ARMCC5-configuration)
		* [STM32F746GDISCO-SNI-CM7hardfp_ARMCC5-fp](STM32F746GDISCO-SNI-CM7hardfp_ARMCC5-fp)

### Build
* From the **Overview** tab of the generated [full.platform](/STM32F746GDISCO-SNI-CM7hardfp_ARMCC5-configuration/full.platform) file
	* Click on the **Build platform** hyperlink. This will generate the following project :
		* [STM32F746GDISCO-SNI-CM7hardfp_ARMCC5-1.0.0](STM32F746GDISCO-SNI-CM7hardfp_ARMCC5-1.0.0)


## API Selection Criteria

Here are a few things to consider when choosing between Shielded Plug and an SNI and Immortals based solution

* Performance
	* Generally speaking, Shielded Plug (SP for short) will copy data from/to a database block and will therefore take more processing time and memory than an SNI-based solution relying on a shared memory area with less data copying.
	* SP is more suitable for asynchronous (post) processing of published data

* Data Integrity
	* Given that with SP there is no buffering of data, it makes it more suitable for sampling scenarios where losing a value once in a while is not critical .

* API convenience
	* SP requires that you describe your data in an xml based configuration file.
	* However, the SP synchronization API is quite simple
	* Using SNI and Immortals, it is easier to pass data directly to/from C native functions

In summary, for simple use cases, Shielded Plug shall suffice, but for more intensive and more constrained environments, SNI and Immortals may be a better fit.

## Additional references

### B-ON Library Specification

Among other things, the **Beyond Profile Specification** document contains detailed information on:

* sharing memory areas between Java and C/C++ using **immortal objects**

**immortal objects** : such objects are never garbage collected and keep the same physical memory location forever. This makes them useful for specifying shared memory areas between C and Java.

The document can be downloaded from [www.e-s-r.net/specifications/index.html](www.e-s-r.net/specifications/index.html)

### SNI Library Specification

The **Simple Native Interface for GreenThread Context Profile Specification** document contains detailed information on :

* how to map Java primitive types to portable C types for methods/functions parameters and return types
* naming conventions for C functions implementing Java SNI native implementations
	* these have to be followed to generate valid linker configuration files
* sharing memory areas between Java and C/C++ using **immortal objects**
* controlling (as in suspend and resume) Java Thread execution from C code

The document can be downloaded from [www.e-s-r.net/specifications/index.html](www.e-s-r.net/specifications/index.html)
	
### Shielded Plug Library Specification

The **Shielded Plug Profile Specification** document contains detailed information on :

* the concepts underlying the Shielded Plug API
* how to map Java primitive types to portable C types for methods/functions parameters and return types
* how to create dedicated readers/writers that can translate Shielded Plug Blocks into Java Objects
* the reference API for both C and Java languages

The document can be downloaded from [www.e-s-r.net/specifications/index.html](www.e-s-r.net/specifications/index.html)
	
### Simulation

The **Simulation** section of the **Device Developer's Guide** document contains useful info for :

* creating Java mocks simulating native code using the same naming conventions as SNI
* using the Hardware In the Loop (HIL) engine as a replacement for the SNI/GreenThread interface used on target environments

To access the document from MicroEJ:

* Select **Help > MicroEJ Resource Center** menu item
	* Select **Manual > Device Developer's Guide**
	
# Requirements

* MicroEJ SDK 4.0.0 or later
* Keil MicroVision v5.0 or later

Arabic Font (Standalone)

Example that shows how to use arabic fonts.
EXAMPLE for UI
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
29 August 2017
# Overview
This example shows how to use the arabic fonts.

# Usage

1. First of all, you must have a font containing the characters of the unicode block called `Arabic Presentation Forms-B` i.e. the range `0xFE70-0xFEFF`.

2. Then your strings must be formed with the characters of this range too (as you can see with the strings of HowToUseArabicFontDisplayable.TITLE and HowToUseArabicFontDisplayable.AVAILABLE_TEXTS, /u0020 corresponds to the space character).
3. Finally the order of the strings must be reversed.

## Run on MicroEJ Simulator
1. Right Click on the project
1. Select **Run as -> MicroEJ Application**
1. Select your platform 
1. Press **Ok**

## Run on device
### Build
1. Right Click on [HowToUseArabicFont.java](HowToUseArabicFont/src/main/java/com/microej/example/arabicfont/HowToUseArabicFont.java)
1. Select **Run as -> Run Configuration**
1. Select **MicroEJ Application** configuration kind
1. Click on **New launch configuration** icon
1. Select **Execute on Device**
1. Select **Build & Deploy**
1. Go to **Execution** tab
	* Select your platform 
1. Press **Apply**
1. Press **Run**
1. Copy the generated `.out` file path

### Flash
1. Use the appropriate flashing tool.

# Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or higher
	* MICROUI-2.0 or higher
	
## Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

Components Hello World (Standalone)

This project illustrates the ej.components library.
EXAMPLE for MISC
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
29 August 2017
# Overview
This project illustrates the _ej.library.runtime.components_ library.
It contains a service implementation and two bundles: the service publisher and the service user.

## Project structure
- [com.microej.example.components.helloworld.service](com.microej.example.components.helloworld.service) 
	- [[â¦]/Hello.java](com.microej.example.components.helloworld.service/src/main/java/com/microej/example/components/helloworld/service/Hello.java): the interface defining the service.

- [com.microej.example.components.helloworld.publisher](com.microej.example.components.helloworld.publisher)
	- [[â¦]/HelloPrint.java](com.microej.example.components.helloworld.publisher/src/main/java/com/microej/example/components/helloworld/publisher/HelloPrint.java) : an implementation of the service.
	- [[â¦]/HelloPublisherBundle.java](com.microej.example.components.helloworld.publisher/src/main/java/com/microej/example/components/helloworld/publisher/HelloPublisherBundle.java) : the bundle publishing the service implementation.
	
- [com.microej.example.components.helloworld.user](com.microej.example.components.helloworld.user)
	- [[â¦]/SayHelloToEveryone.java](com.microej.example.components.helloworld.user/src/main/java/com/microej/example/components/helloworld/user/SayHelloToEveryone.java) : an application that uses the service.
	- [[â¦]/HelloUserBundle.java](com.microej.example.components.helloworld.user/src/main/java/com/microej/example/components/helloworld/user/HelloUserBundle.java) : the bundle retrieving the service.
	
- [com.microej.example.components.helloworld](com.microej.example.components.helloworld) : the startup (main) of the example.
	- [src/main/java](com.microej.example.components.helloworld/src/main/java) : Java sources.
	- [src/main/resources](com.microej.example.components.helloworld/src/main/resources) : the properties and bundles list.

  
## Usage
See [README.md](com.microej.example.components.helloworld/README.md).

# Requirements
See [README.md](com.microej.example.components.helloworld/README.md).

# Source
See [README.md](com.microej.example.components.helloworld/README.md).

# Restrictions
See [README.md](com.microej.example.components.helloworld/README.md).

# Changes
See [CHANGELOG.md](CHANGELOG.md).

## License
See [LICENSE.md](LICENSE.md).

Examples Custom Events for MicroUI

This project illustrate how to propagate custom events from the hardware to MicroUI.
EXAMPLE for MISC
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
29 August 2017
# Overview
This example illustrates how to propagate custom events from the hardware to MicroUI. MicroUI already supports generic events like touch, button and joystick.
Hardware events (e.g. sensors movement) can be used for specific display action upon occurrence.

See the Device Developer's Guide at section **Inputs** (13.5) for more information.

# Usage
1. Create a platform with at least the UI module.
2. Before building this platform, some configuration is required. In the **xxx-configuration project** in the **microui/microui.xml** file, add the following xml element as the first eventgenerator.

        <eventgenerator name="CUSTOM" class="com.microej.example.customevent.CustomEventGenerator"/>

3. Build your platform.
4. In the [/com.microej.example.customevent/src/main/c](com.microej.example.customevent/src/main/c) folder
	1. Choose the file corresponding to the board/RTOS used 
	2. Replace the application entry point in the /xxx-bsp project by the file selected in the previous step
5. In MicroEJ, create a launch configuration for the Java application
	1. Set the name to "CustomEvent_Build"
	2. In the **Main** tab
		1. Set the **Project** field to "com.microej.example.customevent"
		2. Set the **Main type** field  to "CustomEventExample"
	3. In the **Execution** tab
		1. In the **Target** frame, set the JPF to the one built in step #3
		2. In the **Execution** frame, select the **Execute on EmbJPF** radio button
6. Run the launch configuration.
7. Compile, link and flash the xxx-bsp project.

# Requirements
- JRE 7 (or later) x86.
- MicroEJ 4.0 or later.
- Java platform with (at least) EDC-1.2, MICROUI-2.0.

# Project structure
- src/main/java
	- Java sources
- src/main/c
	- Entry points (main.c) examples for the given board/RTOS that generates custom events.

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

Using Foundation Libraries APIs (Standalone)

This project gathers all the basic examples of the foundation libraries.
EXAMPLE for MISC
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: SDK
Last updated:
22 August 2017
# Overview
This project gathers some basic examples of the foundation libraries. Those examples are developed as standalone applications and as such can be run by following the associated instructions (see **README.md** file of each example).

Note that to run them on board:

* If you are using MicroEJ SDK:
 * You need a supported board (see http://developer.microej.com/index.php?resource=JPF for a list of supported boards using MicroEJ SDK evaluation version)
 * And the associated platform binary .jpf file (retrieve it from the previous link and import it into MicroEJ SDK)

* If you are using MicroEJ Studio:
 * You need to convert them from standalone applications to sandboxed applications.
 * Follow the [How-To convert a standalone app into a sandboxed app](https://github.com/MicroEJ/How-To/tree/master/StandaloneToSandboxed) guide.

# Details
## Core
### EDC
EDC contains the minimal standard runtime environment for embedded devices.

**Available Examples**:
* [com.microej.example.foundation.edc.helloworld](com.microej.example.foundation.edc.helloworld): Prints Hello World on the standard output stream.

### BON
BON focuses on devices with non-volatile and volatile memories. This library allows to fully control memory usage and start-up sequences on devices with limited memory resources.

**Available Examples**:

* [com.microej.example.foundation.bon.immortals](com.microej.example.foundation.bon.immortals): Shows how to manipulate the immortals.
* [com.microej.example.foundation.bon.immutables](com.microej.example.foundation.bon.immutables): Shows how to manipulate the immutables.


## Communicate with other hardwares

### ECOM
ECOM libraries provides a standard communication over UART.

**Available Examples**:
* [com.microej.example.foundation.ecom.hotplug](com.microej.example.foundation.ecom.hotplug): Shows how to listen on plug/unplug of dynamic ComConnections and shows their properties.
* [com.microej.example.foundation.ecom.writer](com.microej.example.foundation.ecom.writer): Shows how to write some bytes to a CommConnection.
* [com.microej.example.foundation.ecom.reader](com.microej.example.foundation.ecom.reader): Shows how to read some bytes from a CommConnection.

### HAL
HAL libraries presents an abstraction of the communication with the hardware.

**Available Examples**:
* [com.microej.example.foundation.hal.gpio](com.microej.example.foundation.hal.gpio): Shows how to use gpio.


## Design a user interface

### MicroUI
MicroUI provides the minimal cornerstone for quick construction of advanced, portable and user-friendly applications for a wide and heterogeneous range of devices with just-what-is-needed resources.

**Available Examples**:
* [com.microej.example.foundation.microui.antialiased](com.microej.example.foundation.microui.antialiased): Shows how to use anti-aliased shapes.
* [com.microej.example.foundation.microui.font](com.microej.example.foundation.microui.font): Shows how to create and use a font.
* [com.microej.example.foundation.microui.helloworld](com.microej.example.foundation.microui.helloworld): Shows how to print a string on a display.
* [com.microej.example.foundation.microui.image](com.microej.example.foundation.microui.image): Shows how to create and use images.
* [com.microej.example.foundation.microui.input](com.microej.example.foundation.microui.input): Shows how to listen the MicroUI input events.
* [com.microej.example.foundation.microui.led](com.microej.example.foundation.microui.led): Shows how to use the LEDs.
* [com.microej.example.foundation.microui.movableimage](com.microej.example.foundation.microui.movableimage): Shows how to create and use a movable image.
* [com.microej.example.foundation.microui.mvc](com.microej.example.foundation.microui.mvc): Shows how to create and use a MVC design pattern.
* [com.microej.example.foundation.microui.out](com.microej.example.foundation.microui.out): Shows how to redirect the standard SystemOut to the display.
* [com.microej.example.foundation.microui.transform](com.microej.example.foundation.microui.transform): Shows how to use MicroUI transform.

### MWT
MWT is a widget toolkit designed for a wide range of devices, including embedded devices with limited processing power.

**Available Examples**:
* [com.microej.example.foundation.mwt.helloworld](com.microej.example.foundation.mwt.helloworld): Shows a simple hello world using MWT.
* [com.microej.example.foundation.mwt.mvc](com.microej.example.foundation.mwt.mvc): Shows how to create and use a MVC design pattern.

### NLS
NLS provides tools to use localized strings.

**Available Examples**:
* [com.microej.example.foundation.nls.helloworld](com.microej.example.foundation.nls.helloworld): Shows how to print a localized string on a display.


## Communicate with the world

### NET
NET is a lightweight Java library dedicated to networking applications. It supports stream (TCP/IP) and datagram (UDP) socket connection APIs.

**Available Examples**:
* [com.microej.example.foundation.net.echo](com.microej.example.foundation.net.echo): Shows a simple echo server.
* [com.microej.example.foundation.net.helloworld](com.microej.example.foundation.net.helloworld): Shows a simple helloworld using NET.

## Store data

### FS
FS is a library to access multiple storage devices (in and out data streams) through a simple file system API.

**Available Examples**:
* [com.microej.example.foundation.fs.helloworld](com.microej.example.foundation.fs.helloworld): Creates a list of folders, adds some files and deletes them all.

Using Foundation Libraries APIs (Standalone)

This project gathers all the basic examples of the foundation libraries.
EXAMPLE for MISC
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
22 August 2017
# Overview
This project gathers some basic examples of the foundation libraries. Those examples are developed as standalone applications and as such can be run by following the associated instructions (see **README.md** file of each example).

Note that to run them on board:

* If you are using MicroEJ SDK:
 * You need a supported board (see http://developer.microej.com/index.php?resource=JPF for a list of supported boards using MicroEJ SDK evaluation version)
 * And the associated platform binary .jpf file (retrieve it from the previous link and import it into MicroEJ SDK)

* If you are using MicroEJ Studio:
 * You need to convert them from standalone applications to sandboxed applications.
 * Follow the [How-To convert a standalone app into a sandboxed app](https://github.com/MicroEJ/How-To/tree/master/StandaloneToSandboxed) guide.

# Details
## Core
### EDC
EDC contains the minimal standard runtime environment for embedded devices.

**Available Examples**:
* [com.microej.example.foundation.edc.helloworld](com.microej.example.foundation.edc.helloworld): Prints Hello World on the standard output stream.

### BON
BON focuses on devices with non-volatile and volatile memories. This library allows to fully control memory usage and start-up sequences on devices with limited memory resources.

**Available Examples**:

* [com.microej.example.foundation.bon.immortals](com.microej.example.foundation.bon.immortals): Shows how to manipulate the immortals.
* [com.microej.example.foundation.bon.immutables](com.microej.example.foundation.bon.immutables): Shows how to manipulate the immutables.


## Communicate with other hardwares

### ECOM
ECOM libraries provides a standard communication over UART.

**Available Examples**:
* [com.microej.example.foundation.ecom.hotplug](com.microej.example.foundation.ecom.hotplug): Shows how to listen on plug/unplug of dynamic ComConnections and shows their properties.
* [com.microej.example.foundation.ecom.writer](com.microej.example.foundation.ecom.writer): Shows how to write some bytes to a CommConnection.
* [com.microej.example.foundation.ecom.reader](com.microej.example.foundation.ecom.reader): Shows how to read some bytes from a CommConnection.

### HAL
HAL libraries presents an abstraction of the communication with the hardware.

**Available Examples**:
* [com.microej.example.foundation.hal.gpio](com.microej.example.foundation.hal.gpio): Shows how to use gpio.


## Design a user interface

### MicroUI
MicroUI provides the minimal cornerstone for quick construction of advanced, portable and user-friendly applications for a wide and heterogeneous range of devices with just-what-is-needed resources.

**Available Examples**:
* [com.microej.example.foundation.microui.antialiased](com.microej.example.foundation.microui.antialiased): Shows how to use anti-aliased shapes.
* [com.microej.example.foundation.microui.font](com.microej.example.foundation.microui.font): Shows how to create and use a font.
* [com.microej.example.foundation.microui.helloworld](com.microej.example.foundation.microui.helloworld): Shows how to print a string on a display.
* [com.microej.example.foundation.microui.image](com.microej.example.foundation.microui.image): Shows how to create and use images.
* [com.microej.example.foundation.microui.input](com.microej.example.foundation.microui.input): Shows how to listen the MicroUI input events.
* [com.microej.example.foundation.microui.led](com.microej.example.foundation.microui.led): Shows how to use the LEDs.
* [com.microej.example.foundation.microui.movableimage](com.microej.example.foundation.microui.movableimage): Shows how to create and use a movable image.
* [com.microej.example.foundation.microui.mvc](com.microej.example.foundation.microui.mvc): Shows how to create and use a MVC design pattern.
* [com.microej.example.foundation.microui.out](com.microej.example.foundation.microui.out): Shows how to redirect the standard SystemOut to the display.
* [com.microej.example.foundation.microui.transform](com.microej.example.foundation.microui.transform): Shows how to use MicroUI transform.

### MWT
MWT is a widget toolkit designed for a wide range of devices, including embedded devices with limited processing power.

**Available Examples**:
* [com.microej.example.foundation.mwt.helloworld](com.microej.example.foundation.mwt.helloworld): Shows a simple hello world using MWT.
* [com.microej.example.foundation.mwt.mvc](com.microej.example.foundation.mwt.mvc): Shows how to create and use a MVC design pattern.

### NLS
NLS provides tools to use localized strings.

**Available Examples**:
* [com.microej.example.foundation.nls.helloworld](com.microej.example.foundation.nls.helloworld): Shows how to print a localized string on a display.


## Communicate with the world

### NET
NET is a lightweight Java library dedicated to networking applications. It supports stream (TCP/IP) and datagram (UDP) socket connection APIs.

**Available Examples**:
* [com.microej.example.foundation.net.echo](com.microej.example.foundation.net.echo): Shows a simple echo server.
* [com.microej.example.foundation.net.helloworld](com.microej.example.foundation.net.helloworld): Shows a simple helloworld using NET.

## Store data

### FS
FS is a library to access multiple storage devices (in and out data streams) through a simple file system API.

**Available Examples**:
* [com.microej.example.foundation.fs.helloworld](com.microej.example.foundation.fs.helloworld): Creates a list of folders, adds some files and deletes them all.

Using IOT Libraries APIs (Sandboxed)

This project gathers simple Sandboxed application using net libraries.
EXAMPLE for IOT
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
6 July 2017
# Overview
This project gathers simple sandboxed applications using net libraries.

## Requirements
* MicroEJ Studio or SDK 4.0 or later

# Usage
Each subfolder contains a distinct IOT application.

# Changes
- See the change log file [CHANGELOG.md](CHANGELOG.md) located at the root of this repository.

# License
- See the license file [LICENSE.md](LICENSE.md) located at the root of this repository.

Examples Custom Events for MicroUI

This project illustrate how to propagate custom events from the hardware to MicroUI.
EXAMPLE for MISC
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: SDK
Last updated:
25 January 2017
# Overview
This example illustrates how to propagate custom events from the hardware to MicroUI. MicroUI already supports generic events like touch, button and joystick.
Hardware events (e.g. sensors movement) can be used for specific display action upon occurrence.

See the Device Developer's Guide at section **Inputs** (13.5) for more information.

# Usage
1. Create a platform with at least the UI module.
2. Before building this platform, some configuration is required. In the **xxx-configuration project** in the **microui/microui.xml** file, add the following xml element as the first eventgenerator.

        <eventgenerator name="CUSTOM" class="com.microej.example.customevent.CustomEventGenerator"/>

3. Build your platform.
4. In the [/com.microej.example.customevent/src/main/c](com.microej.example.customevent/src/main/c) folder
	1. Choose the file corresponding to the board/RTOS used 
	2. Replace the application entry point in the /xxx-bsp project by the file selected in the previous step
5. In MicroEJ, create a launch configuration for the Java application
	1. Set the name to "CustomEvent_Build"
	2. In the **Main** tab
		1. Set the **Project** field to "com.microej.example.customevent"
		2. Set the **Main type** field  to "CustomEventExample"
	3. In the **Execution** tab
		1. In the **Target** frame, set the JPF to the one built in step #3
		2. In the **Execution** frame, select the **Execute on EmbJPF** radio button
6. Run the launch configuration.
7. Compile, link and flash the xxx-bsp project.

# Requirements
- JRE 7 (or later) x86.
- MicroEJ 4.0 or later.
- Java platform with (at least) EDC-1.2, MICROUI-2.0.

# Project structure
- src/main/java
	- Java sources
- src/main/c
	- Entry points (main.c) examples for the given board/RTOS that generates custom events.

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

B&W Smartwatch using MWT (Standalone)

A black and white smartwatch. This application has been designed for a 240x240 screen. It has been tested on a STM32-F412-DISCO board.
EXAMPLE for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: SDK
Last updated:
23 January 2017
# Overview
A black and white smartwatch. This application has been designed for a 2BPP 240x240 screen. It has been tested on a STM32-F412-DISCO board.

![BlackClock](screenshots/BlackClock.png) ![Weather](screenshots/Weather.png) ![DigitalClock](screenshots/DigitalClock.png) ![Distance](screenshots/Distance.png) ![Battery](screenshots/Battery.png) ![Notifications](screenshots/Notifications.png)

## Usage
## Run on MicroEJ Simulator
1. Right Click on the project
2. Select **Run as -> MicroEJ Application**
3. Select your platform 
4. Press **Ok**


## Run on device
### Build
1. Right Click on [SmartWatchApp.java](src/main/java/com/microej/demo/smartwatch/SmartWatchApp.java)
2. Select **Run as -> Run Configuration**
3. Select **MicroEJ Application** configuration kind
4. Click on **New launch configuration** icon
5. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a relevant platform (but not a virtual device)
	2. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
6. Press **Apply**
7. Press **Run**
8. Copy the generated `.out` file path shown by the console

### Flash
1. Use the appropriate flashing tool.


# Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or higher
	* MICROUI-2.0 or higher
	* MWT-2.0 or higher

## Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

## Restrictions
None.

B&W Smartwatch using MWT (Sandboxed)

A black and white smartwatch. This application has been designed for a 240x240 screen. It has been tested on a STM32-F412-DISCO board.
EXAMPLE for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio
Last updated:
23 January 2017
# Overview
A black and white smartwatch. This application has been designed for a 2BPP 240x240 screen. It has been tested on a STM32-F412-DISCO board.

![WhiteClock](screenshots/WhiteClock.png) ![Weather](screenshots/Weather.png) ![DigitalClock](screenshots/DigitalClock.png) ![Distance](screenshots/Distance.png) ![Battery](screenshots/Battery.png) ![Notifications](screenshots/Notifications.png)

## Usage
## Run on MicroEJ Simulator
1. Right Click on the project
2. Select **Run as -> MicroEJ Application**
3. Select your platform 
4. Press **Ok**


## Run on device
### Build
1. Right Click on [SmartWatchApp.java](src/main/java/com/microej/demo/smartwatch/SmartWatchApp.java)
2. Select **Run as -> Run Configuration**
3. Select **MicroEJ Application** configuration kind
4. Click on **New launch configuration** icon
5. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a relevant platform (but not a virtual device)
	2. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
6. Press **Apply**
7. Press **Run**
8. Copy the generated `.out` file path shown by the console

### Flash
1. Use the appropriate flashing tool.


# Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or higher
	* MICROUI-2.0 or higher
	* MWT-2.0 or higher

## Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

## Restrictions
None.

Examples Eclasspath

This project gather all the examples of eclasspath.
EXAMPLE for MISC
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
23 January 2017
# Overview

This project gather all the examples of eclasspath. Eclasspath contains Java runtime libraries.

Note that to run them on board:

* If you are using MicroEJ SDK:
 * You need a supported board (see http://developer.microej.com/index.php?resource=JPF for a list of supported boards using MicroEJ SDK evaluation version)
 * And the associated platform binary .jpf file (retrieve it from the previous link and import it into MicroEJ SDK)

* If you are using MicroEJ Studio:
 * You need to convert them from standalone applications to sandboxed applications.
 * Follow the [How-To convert a standalone app into a sandboxed app](https://github.com/MicroEJ/How-To/tree/master/StandaloneToSandboxed) guide.
 
# Details
## logging
**Available Examples**:
* [com.microej.examples.eclasspath.logging](com.microej.examples.eclasspath.logging) : Writes in the logger.

Arabic Font (Standalone)

Example that shows how to use arabic fonts.
EXAMPLE for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: SDK
Last updated:
23 January 2017
# Overview
This example shows how to use the arabic fonts.

# Usage

1. First of all, you must have a font containing the characters of the unicode block called `Arabic Presentation Forms-B` i.e. the range `0xFE70-0xFEFF`.

2. Then your strings must be formed with the characters of this range too (as you can see with the strings of HowToUseArabicFontDisplayable.TITLE and HowToUseArabicFontDisplayable.AVAILABLE_TEXTS, /u0020 corresponds to the space character).
3. Finally the order of the strings must be reversed.

## Run on MicroEJ Simulator
1. Right Click on the project
1. Select **Run as -> MicroEJ Application**
1. Select your platform 
1. Press **Ok**

## Run on device
### Build
1. Right Click on [HowToUseArabicFont.java](HowToUseArabicFont/src/main/java/com/microej/example/arabicfont/HowToUseArabicFont.java)
1. Select **Run as -> Run Configuration**
1. Select **MicroEJ Application** configuration kind
1. Click on **New launch configuration** icon
1. Select **Execute on Device**
1. Select **Build & Deploy**
1. Go to **Execution** tab
	* Select your platform 
1. Press **Apply**
1. Press **Run**
1. Copy the generated `.out` file path

### Flash
1. Use the appropriate flashing tool.

# Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or higher
	* MICROUI-2.0 or higher
	
## Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

Components Hello World

This project illustrates the ej.components library.
EXAMPLE for MISC
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
23 January 2017
# Overview
This project illustrates the _ej.library.runtime.components_ library.
It contains a service implementation and two bundles: the service publisher and the service user.

## Project structure
- [com.microej.example.components.helloworld.service](com.microej.example.components.helloworld.service) 
	- [[â¦]/Hello.java](com.microej.example.components.helloworld.service/src/main/java/com/microej/example/components/helloworld/service/Hello.java): the interface defining the service.

- [com.microej.example.components.helloworld.publisher](com.microej.example.components.helloworld.publisher)
	- [[â¦]/HelloPrint.java](com.microej.example.components.helloworld.publisher/src/main/java/com/microej/example/components/helloworld/publisher/HelloPrint.java) : an implementation of the service.
	- [[â¦]/HelloPublisherBundle.java](com.microej.example.components.helloworld.publisher/src/main/java/com/microej/example/components/helloworld/publisher/HelloPublisherBundle.java) : the bundle publishing the service implementation.
	
- [com.microej.example.components.helloworld.user](com.microej.example.components.helloworld.user)
	- [[â¦]/SayHelloToEveryone.java](com.microej.example.components.helloworld.user/src/main/java/com/microej/example/components/helloworld/user/SayHelloToEveryone.java) : an application that uses the service.
	- [[â¦]/HelloUserBundle.java](com.microej.example.components.helloworld.user/src/main/java/com/microej/example/components/helloworld/user/HelloUserBundle.java) : the bundle retrieving the service.
	
- [com.microej.example.components.helloworld](com.microej.example.components.helloworld) : the startup (main) of the example.
	- [src/main/java](com.microej.example.components.helloworld/src/main/java) : Java sources.
	- [src/main/resources](com.microej.example.components.helloworld/src/main/resources) : the properties and bundles list.

  
## Usage
See [README.md](com.microej.example.components.helloworld/README.md).

# Requirements
See [README.md](com.microej.example.components.helloworld/README.md).

# Source
See [README.md](com.microej.example.components.helloworld/README.md).

# Restrictions
See [README.md](com.microej.example.components.helloworld/README.md).

# Changes
See [CHANGELOG.md](CHANGELOG.md).

## License
See [LICENSE.md](LICENSE.md).

Using SNI and SP Libraries API (Standalone)

This repository contains examples showing how to enable communication between programs written in C and programs written in Java.
EXAMPLE for MISC
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: SDK
Last updated:
12 August 2016
[](Markdown)
[](Copyright 2016 IS2T. All rights reserved.)
[](IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.)
# Overview

Although MicroEJ lets you leverage Java in an embedded context, there are still some cases where your Java threads need to synchronize and exchange data with OS tasks written in C/C++.

This repository contains examples showing how to enable communication between programs written in C and programs written in Java using MicroEJ APIs.

## Available examples

For tasks/threads synchronisation via function calls and callbacks, MicroEJ provides the SNI API.
For data exchange issues between tasks/threads, MicroEJ provides a few options:
* Shielded Plug API (suitable for sharing structured data, with built-in wait/release synchronisation APIs)
* Immortals API and SNI API (suitable for sharing access to raw data, but you need to provide your own synchronisation mechanism)

The following examples, most of them based on the consumer/producer problem, illustrate how to use those APIs :
* [Making synchronous C functions calls from Java](/CallingCFromJava) using SNI
* [Producer Consumer with ShieldedPlug](/ProducerConsumerUsingShieldedPlug) using Shielded Plug API as the delivery mechanism
* [Producer Consumer with SNI and Immortals](/ProducerConsumerUsingQueues) using SNI and Immortals APIs to wrap the native FreeRTOS message queue API as the delivery mechanism

Each example comes with a launch configuration. These launch configurations require that the target platform (common to each configuration) is built.

To build the platform :
* Open the [full.platform]([/STM32F746GDISCO-SNI_SP-CM7_ARMCC-FreeRTOS-configuration/full.platform]) file
* Click on the **Build Platform** hyperlink in the **Build** frame

## API Selection Criteria

Here are a few things to consider when choosing between Shielded Plug and an SNI and Immortals based solution

* Performance
	* Generally speaking, Shielded Plug (SP for short) will copy data from/to a database block and will therefore take more processing time and memory than an SNI-based solution relying on a shared memory area with less data copying.
	* SP is more suitable for asynchronous (post) processing of published data

* Data Integrity
	* Given that with SP there is no buffering of data, it makes it more suitable for sampling scenarios where losing a value once in a while is not critical .

* API convenience
	* SP requires that you describe your data in an xml based configuration file.
	* However, the SP synchronization API is quite simple
	* Using SNI and Immortals, it is easier to pass data directly to/from C native functions

In summary, for simple use cases, Shielded Plug shall suffice, but for more intensive and more constrained environments, SNI and Immortals may be a better fit.

## Additional references

Additional examples can be found at the following locations:
* Java/C Data Sharing Using SNI application note on www.microej.com.
* Synchronizing a Java thread with C task(s) application note on www.microej.com.

### B-ON Library Specification

Among other things, the **Beyond Profile Specification** document contains detailed information on:

* sharing memory areas between Java and C/C++ using **immortal objects**

**immortal objects** : such objects are never garbage collected and keep the same physical memory location forever. This makes them useful for specifying shared memory areas between C and Java.

To access the document from MicroEJ:

* Select **Help > MicroEJ Resource Center** menu item
	* Select **Library Specification > BON 1.2**

### SNI Library Specification

The **Simple Native Interface for GreenThread Context Profile Specification** document contains detailed information on :

* how to map Java primitive types to portable C types for methods/functions parameters and return types
* naming conventions for C functions implementing Java SNI native implementations
	* these have to be followed to generate valid linker configuration files
* sharing memory areas between Java and C/C++ using **immortal objects**
* controlling (as in suspend and resume) Java Thread execution from C code

To access the document from MicroEJ:

* Select **Help > MicroEJ Resource Center** menu item
	* Select **Library Specification > SNI_GT 1.2**
	
### Shielded Plug Library Specification

The **Shielded Plug Profile Specification** document contains detailed information on :

* the concepts underlying the Shielded Plug API
* how to map Java primitive types to portable C types for methods/functions parameters and return types
* how to create dedicated readers/writers that can translate Shielded Plug Blocks into Java Objects
* the reference API for both C and Java languages

To access the document from MicroEJ:

* Select **Help > MicroEJ Resource Center** menu item
	* Select **Library Specification > SP 1.0**
	
### Simulation

The **Simulation** section of the **platform architecture manual** document contains useful info for :

* creating Java mocks simulating native code using the same naming conventions as SNI
* using the Hardware In the Loop (HIL) engine as a replacement for the SNI/GreenThread interface used on target environments

To access the document from MicroEJ:

* Select **Help > MicroEJ Resource Center** menu item
	* Select **Manual > Platform Architecture - User Manual**
	
# Requirements

* MicroEJ SDK 4.0.0 or later
* Keil MicroVision v5.0 or later

Widget (Standalone)

This demo illustrates the Widget library (ej.widget, ej.container, ej.style, ej.navigation, ej.color) based on MicroUI 2 and MWT 2.
EXAMPLE for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: SDK
Last updated:
30 June 2016
# Overview
This demo illustrates the Widget library (ej.widget, ej.container, ej.style, ej.navigation, ej.color) based on MicroUI 2 and MWT 2.
The main page allows to lead to all the pages of the application illustrating the following widgets:
- button,
- label,
- scrolling list,
- scroll bar,
- slider,
- radio button,
- check box,
- switch,
- progress bar,
- vertical lists.

# Rendering
This demo includes various implementations of widgets and screen transitions.

## Vector drawings
Widgets are drawn using 2D primitives with and without anti-aliasing. This approach uses more CPU time but no ROM (no graphic resources except the code itself).

See `GraphicsContext` and `AntiAliasedShapes` classes for more information. 

## Raster graphics (images)
Widgets are drawn using images. This approach requires more ROM depending on the size and number of images used. It is most of the time faster than vector drawing and requires less CPU load.

Images can be either embedded encoded (PNG for example, decoded at runtime) or embedded as bitmaps (directly drawn to the display, the conversion is done on at build time).

See UI reference manual for more information.

## Pictograms (monochrome images)
Widgets are drawn using monochrome images that can be colored dynamically. This approach requires less ROM than using colorful images but can only be applied for monochrome elements.

It can be achieved using fonts (MicroEJ font designer can import images into a font) or monochrome images with alpha transparency.

See UI reference manual for more information.

# Transitions
This demo includes two implementations of screens transition.

## Snapshot
Screens are dynamically created as images (buffer in RAM) for the transition. This approach requires more RAM (twice the size of the screen in buffers) but is faster than the 2nd implementation.

## Dynamic
Screens are drawn while moving. For each step of the transition, all widgets are drawn in the moving screen. This approach uses more CPU but less RAM. Transition speed might be slower depending on the number of widgets to draw.


# Project Setup
First of all, you have to download the entire repository by using the `Download` button or by cloning the repository. After having retrieved the repository content, open MicroEJ and then import _Existing project into workspace_ by selecting either the ZIP file or the root directory.

## Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or higher
	* MICROUI-2.0 or higher
	* MWT-2.1 or higher
* Hardware: this demo has been tested on ST STM32F746G-DISCO (480x272 display) board.

## Project structure
  - `src/main/java`: Java sources.
  		`ej.demo.ui.widget.page`: pages of the demo.
  		`ej.demo.ui.widget.style`: look and feel management of the demo.
  		`WidgetsDemo`: entry point of the demo.
  - `src/main/resources`: images, fontsâ¦

# Usage
## Run on MicroEJ Simulator
1. Right Click on the project
1. Select **Run as -> MicroEJ Application**
1. Select your platform 
1. Press **Ok**

## Run on device
### Build
1. Right Click on [WidgetsDemo.java](ej.demo.ui.widget/src/main/java/ej/demo/ui/widget/WidgetsDemo.java)
1. Select **Run as -> Run Configuration**
1. Select **MicroEJ Application** configuration kind
1. Click on **New launch configuration** icon
1. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a relevant platform (but not a virtual device)
	1. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
1. Press **Apply**
1. Press **Run**
1. Copy the generated `.out` file path shown by the console

### Flash
1. Use the appropriate flashing tool.

# MicroUI vs. MWT+Widget
By default, consider using MWT+Widget.
It is however possible to develop a GUI with MicroUI without MWT+Widget libraries:
* when there is no or little user interaction,
* for simple screens and a limited number of widgets,
* for simple screen layout,
* for small screens (which implies they need to be simple!),
* for quick image-based design tests.

# Changes
- See the change log file [CHANGELOG.md](CHANGELOG.md) located at the root of this repository.

# License
See the license file [LICENSE.md](LICENSE.md) located at the root of this repository.

Widget (Sandboxed)

This demo illustrates the Widget library (ej.widget, ej.container, ej.style, ej.navigation, ej.color) based on MicroUI 2 and MWT 2.
EXAMPLE for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
30 June 2016
# Overview
This demo illustrates the Widget library (ej.widget, ej.container, ej.style, ej.navigation, ej.color) based on MicroUI 2 and MWT 2.
The main page allows to lead to all the pages of the application illustrating the following widgets:
- button,
- label,
- scrolling list,
- scroll bar,
- slider,
- radio button,
- check box,
- switch,
- progress bar,
- vertical lists.

# Rendering
This demo includes various implementations of widgets and screen transitions.

## Vector drawings
Widgets are drawn using 2D primitives with and without anti-aliasing. This approach uses more CPU time but no ROM (no graphic resources except the code itself).

See `GraphicsContext` and `AntiAliasedShapes` classes for more information. 

## Raster graphics (images)
Widgets are drawn using images. This approach requires more ROM depending on the size and number of images used. It is most of the time faster than vector drawing and requires less CPU load.

Images can be either embedded encoded (PNG for example, decoded at runtime) or embedded as bitmaps (directly drawn to the display, the conversion is done on at build time).

See UI reference manual for more information.

## Pictograms (monochrome images)
Widgets are drawn using monochrome images that can be colored dynamically. This approach requires less ROM than using colorful images but can only be applied for monochrome elements.

It can be achieved using fonts (MicroEJ font designer can import images into a font) or monochrome images with alpha transparency.

See UI reference manual for more information.

# Transitions
This demo includes two implementations of screens transition.

## Snapshot
Screens are dynamically created as images (buffer in RAM) for the transition. This approach requires more RAM (twice the size of the screen in buffers) but is faster than the 2nd implementation.

## Dynamic
Screens are drawn while moving. For each step of the transition, all widgets are drawn in the moving screen. This approach uses more CPU but less RAM. Transition speed might be slower depending on the number of widgets to draw.


# Project Setup
First of all, you have to download the entire repository by using the `Download` button or by cloning the repository. After having retrieved the repository content, open MicroEJ and then import _Existing project into workspace_ by selecting either the ZIP file or the root directory.

## Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or higher
	* MICROUI-2.0 or higher
	* MWT-2.1 or higher
* Hardware: this demo has been tested on ST STM32F746G-DISCO (480x272 display) board.

## Project structure
  - `src/main/java`: Java sources.
  		`ej.demo.ui.widget.page`: pages of the demo.
  		`ej.demo.ui.widget.style`: look and feel management of the demo.
  		`WidgetsDemo`: entry point of the demo.
  - `src/main/resources`: images, fontsâ¦

# Usage
## Run on MicroEJ Simulator
1. Right Click on the project
1. Select **Run as -> MicroEJ Application**
1. Select your platform 
1. Press **Ok**

## Run on device
### Build and Deploy
1. Right Click on [WidgetsDemo.java](ej.demo.ui.widget/src/main/java/ej/demo/ui/widget/WidgetsDemo.java)
1. Select **Run as -> Run Configurations...** 
1. Select **MicroEJ Application** configuration kind
1. Click on **New launch configuration** icon
1. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a relevant platform
	1. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
1. In **Configuration** tab
	1. In **Board** frame
		1. Set **Host** field to your board IP address
1. Press **Apply**
1. Press **Run**

# MicroUI vs. MWT+Widget
By default, consider using MWT+Widget.
It is however possible to develop a GUI with MicroUI without MWT+Widget libraries:
* when there is no or little user interaction,
* for simple screens and a limited number of widgets,
* for simple screen layout,
* for small screens (which implies they need to be simple!),
* for quick image-based design tests.

# Changes
- See the change log file [CHANGELOG.md](CHANGELOG.md) located at the root of this repository.

# License
See the license file [LICENSE.md](LICENSE.md) located at the root of this repository.

Adding a Front Panel Mock

This Application Note explains the steps involved in adding a visual component (ie: a Front Panel Mock) to a MicroEJ Java Platform in the Simulator. It explains in details all the steps required to create the Front Panel Mock and test it with a simple application that draws on the display and reacts to hardware button presses.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Adding Support For a Display

This Application Note explains how to create a MicroEJ Platform with support for a display. It explains in detail all the steps required to build the platform and test it with a simple application that draws on the display.
EXAMPLE for IO
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Adding Support For Inputs

This Application Note details the steps involved in adding support for inputs to a MicroEJ Platform. It explains all the steps required to enhance the platform and test it with a simple Java application that outputs text via the board's serial port when a hardware button is pressed.
EXAMPLE for IO
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Building a Bare Metal MicroEJ Platform

This document explains how to create a MicroEJ Platform to run a multi-threaded application without Real Time Operating System (RTOS).
EXAMPLE for CORE
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Building a MicroEJ Platform from scratch

This document explains how to create a MicroEJPlatform using the MicroEJ environment and the ST Standard Peripherals Library, and how to build it using Keil uVision
EXAMPLE for CORE
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Connecting GPIOs Using SNI

This document explains how to access General Purpose I/O (GPIO) pins from a MicroEJ Platform using the Simple Native Interface (SNI) and the ST Standard Peripherals Library, and how to build it using Keil uVision.
EXAMPLE for IO
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Java/C Data Sharing using SNI

This Application Note explains how to share data between Java and C tasks.
EXAMPLE for CORE
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Native Resource Management

This Application Note explains how to automate the release of native resources used by Java objects. Native resources here mainly refer to those system resources that are not directly managed by MicroEJ.
EXAMPLE for FILEDATA
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Scheduler-Based Application: Mixing Java and C

This Application Note explains how to port a scheduler for a C program to a MicroEJ Platform using the MicroEJ VEE and the ST Standard Peripherals Library and how to build it using Keil uVision.
EXAMPLE for CORE
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Synchronizing a Java thread with C task(s)

This Application Note explains how to synchronize a MicroEJ thread with one or more C tasks. The example shown uses the Keil RTX Kernel.
EXAMPLE for CORE
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Tutorial: Widgets Design With the MWT Library

This Application Note explains all aspects of the MWT library.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Using the ECOM Comm API

This Application Note explains how to use the ECOM Comm API to add support for serial communication.
EXAMPLE for COMM
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016
These MicroEJ projects provide examples for MWT.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
18 September 2015
# Overview
This repository provides a collection of MWT examples. Each example has its own Eclipse/MicroEJ project.

## Project structure
Each folder is an Eclipse/MicroEJ project. They share a common structure:
- `src/main/java`
  - Java sources
- `src/main/resources`
  - Fonts/images
- `launches/`: MicroEJ launches

## Basic
This project shows how to create a basic MWT application. If you are new to MWT, you should start with this example.
It demonstrates the core concepts of MWT:
- Theme and Look,
- Widgets and Renderers,
- Composite.

It also shows how to periodically update the widget data.
Traces to standard output show which thread executes key methods.

### Requirements
- JRE 7 (or later) x86.
- MicroEJ 3.1 or later.
- Java platform with (at least) EDC-1.2, MWT-1.0.

## Button
This project shows how to create two buttons to modify a label with MWT.

### Requirements
- JRE 7 (or later) x86.
- MicroEJ 3.1 or later.
- Java platform with (at least) EDC-1.2, MWT-1.0.

## SlidingWidget
 This example shows how to slide widgets inside a composite. Two implementations are provided. 
 The first implementation is full widget based (all widgets are drawn during the animations - take more CPU time, consume no additional RAM) and the second implementation is screenshot based (1. current framebuffer content is saved to an image1 (local RAM buffer). 2. New screen is drawn in image2. 3. Animation is done by drawing image1 and image2. Consumes more RAM but takes less CPU time).
 
### Requirements
- JRE 7 (or later) x86.
- MicroEJ 3.1 or later.
- Java platform with (at least) EDC-1.2, BON-1.2, MICROUI-1.5.0, MWT-1.0, EJ.MOTION-2.1.

## Setup
Import the projects in MicroEJ.

## Usage
Import the projects. Each project comes with a Run Configuration. Simply run it to execute the example on SimJPF.

## Changes
Share Basic and Button examples.
Add SlidingWidget example and restructure Basic and Button examples.

## License
See the license file `LICENSE.md` located at the root of this repository.

MQTT Example

MQTT example for MicroEJ.
EXAMPLE for IOT
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
23 July 2015
# Overview
The following projects illustrate the Paho library.

## MQTTHelloWorld
The project `HelloWorld` shows the 2 main features of Paho:
- the publication of messages in a topic with the `HelloWorldPublisher` entry point.
- the subscription to a topic with the `HelloWorldSubscriber` entry point.

### Requirements
- JRE 7 (or later) x86.
- MicroEJ 3.1 or later.
- Java platform with (at least) EDC-1.2, NET-EMBEDDED-1.0, the MicroEJ fork of org.eclipse.paho.client (the Paho library is set as an ivy dependancy in module.ivy and will be resolved by ivy).

### Project structure
- `src/main/java`
  - Java sources
- `launches/`: MicroEJ launches

### Configuration
- Set your MQTT broker url by changing the value of `com.is2t.example.mqtt.HelloWorldConstants.BROKER`.
- Set your network configuration by going in your launch in the `Configuration` tab in the `Net Embedded > Network Settings` section.

### Launches
A Simulation and an Embedded launches are available for each entry point.

## Changes
- MQTTHelloWorld example.

## License
See the license file `LICENSE.md` located at the root of this repository.
Example that shows how to use arabic fonts.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
23 July 2015
# Overview
The following projects show how to use the arabic fonts.

## HowToUseArabicFont
This example shows how to correctly render the arabic strings.

Here are the steps to do it:
1. First of all, you must have a font containing the characters of the unicode block called `Arabic Presentation
Forms-B` i.e. the range `0xFE70-0xFEFF`.
2. Then your strings must be formed with the characters of this range too (as you
can see with the strings of HowToUseArabicFontDisplayable.TITLE and HowToUseArabicFontDisplayable.AVAILABLE_TEXTS, /u0020 corresponds to the space character).
3. Finally the order of the strings must be reversed.

### Requirements
- JRE 7 (or later) x86.
- MicroEJ 3.1 or later.
- Java platform with (at least) EDC-1.2, MICROUI-1.5.0.

### Project structure
- `src/main/java`
  - Java sources
- `src/main/resources`
  - Font
- `launches/`: MicroEJ launches

### Launches
A Simulation and an Embedded launches are available.

## Changes
- HowToUseArabicFont example.

## License
See the license file `LICENSE.md` located at the root of this repository.

Resources in External MCU Memories

Example that shows how to store resources in external non-byte addressable memories.
EXAMPLE for MISC
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
23 July 2015
# Overview
The following project illustrates the MicroEJ external resource loader feature (used for resources stored on non-byte-addressable memories).

## ExternalImages
This example displays images supposed to be in the external resources.

### Requirements
- JRE 7 (or later) x86.
- MicroEJ 3.1 or later.
- Java platform with (at least) EDC-1.2, MICROUI-1.5.0 and containing the module `External Resources Loader`.

### Project structure
- `src/main/java`
  - Java sources
- `externalResources`: Images supposed to be in the external resources
- `launches/`: MicroEJ launches

### Launches
A Simulation and an Embedded launches are available.

## LLEXT implementations

### LLEXT_static_array.c
This file should be part of a MICROEJ -bsp project and is the low level driver for the external resource module.
This implementation simply stores the images in a static array (as PNG encoded).
You can also use decoded images (bitmap) generated by the image generator in MicroEJ.

## Changes
- First release: ExternalImages example and LLEXT_static_array.c.

## License
See the license file `LICENSE.md` located at the root of this repository.

Numeric Matrix

This project illustrates useful matrix operations (creation, add, sub, mul, etc.).
EXAMPLE for NUM
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
18 June 2015
# Overview
This project illustrates some matrix operations (creation, add, sub, mul, etc)

## Project Setup
First of all, you have to download the entire repository by using the Download button or by cloning the repository. After having retrieved the repository content, open MicroEJ and then import Existing project into workspace by selecting either the ZIP file or the root directory.

### Requirements
- JRE 7 (or later) x86
- MicroEJ 3.1 or later
- A Java Platform to test with at least: EDC 1.2 & EJ.NUMERIC 1.0.

### Project structure
- MatrixExample: the example file.

## Usage
- Open the launch: Run > Run Configurations > Numeric matrix (Sim) or Numeric Matrix (Emb)
- In the Execution tab select your platform.
- Save the changes and click on Run.

## Changes
2015/06/18: Initial version.

## License
See the license file `LICENSE.md` located at the root of this repository.
This project illustrates the computational of the Discrete Fourier Transform and its inverse by using the Fast Fourier Transform algorithm.
EXAMPLE for NUM
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
18 June 2015
# Overview
This project illustrates the computational of the Discrete Fourier Transform and it's inverse by using the Fast Fourier Transform algorithm.

## Project Setup
First of all, you have to download the entire repository by using the Download button or by cloning the repository. After having retrieved the repository content, open MicroEJ and then import Existing project into workspace by selecting either the ZIP file or the root directory.

### Requirements
- JRE 7 (or later) x86
- MicroEJ 3.1 or later
- A Java Platform to test with at least: EDC 1.2 & EJ.NUMERIC 1.0.

### Project structure
- FFTExample: the example file.

## Usage
- Open the launch: Run > Run Configurations > Numeric FFT (Sim) or Numeric FFT (Emb)
- In the Execution tab select your platform.
- Save the changes and click on Run.

## Changes
2015/06/18: Initial version.

## License
See the license file `LICENSE.md` located at the root of this repository.

Numeric Linear

This project show how to solve a linear equation, to compute eigens values and to compute some matrix factorization.
EXAMPLE for NUM
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
18 June 2015
# Overview
This project show how to solve a linear equation, to compute eigens values and to compute some matrix factorization.

## Project Setup
First of all, you have to download the entire repository by using the Download button or by cloning the repository. After having retrieved the repository content, open MicroEJ and then import Existing project into workspace by selecting either the ZIP file or the root directory.

### Requirements
- JRE 7 (or later) x86
- MicroEJ 3.1 or later
- A Java Platform to test with at least: EDC 1.2 & EJ.NUMERIC 1.0.

### Project structure
- LinearExample: the example file.

## Usage
- Open the launch: Run > Run Configurations > Numeric Linear (Sim) or Numeric Linear (Emb)
- In the Execution tab select your platform.
- Save the changes and click on Run.

## Changes
2015/06/18: Initial version.

## License
See the license file `LICENSE.md` located at the root of this repository.

Components Hello World

This project illustrates the ej.components library.
EXAMPLE for MISC
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
16 June 2015
# Overview
This project illustrates the _ej.components_ library.
It contains a service implementation and two bundles: the service publisher and the service user.

## Project Setup
First of all, you have to download the repository by using the Download button or by cloning the repository.
After having retrieved the repository content, open your MicroEJ and then import Existing project into workspace by selecting either the ZIP file or the root directory.

### Requirements
- JRE 7 (or later) x86
- MicroEJ 3.1 or later
- A Java platform to test with at least: EDC 1.2 & EJ.COMPONENTS 2.0 & LOGGING-LIGHTWEIGHT 2.0.

### Project structure
- `helloService`
  - `[â¦]/Hello.java`: the interface defining the service.
- `helloPublisher`
  - `[â¦]/HelloPrint.java`: an implementation of the service.
  - `[â¦]/HelloPublisherBundle.java`: the bundle publishing the service implementation.
- `helloUser`
  - `[â¦]/SayHelloToEveryone.java`: an application that uses the service.
  - `[â¦]/HelloUserBundle.java`: the bundle retrieving the service.
- `helloWorld`: the startup (main) of the example.
  - `src/main/java`: Java sources.
  - `src/main/resources`: the properties and bundles list.
  - `launches`: the MicroEJ launches.

## Usage
To launch the application, right-click on the `helloWorld` project,
select `Run as`, `MicroEJ Application` and choose `Hello World Components (Sim)`.
Another launcher is available to execute on the target board.

## Changes
2015/06/15: Initial version.

## License
See the license file `LICENSE.md` located at the root of this repository.
This MicroEJ project provides widget examples for MWT v1.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
16 April 2015
# Overview
This demo represents a settings menu you can find on your smartphone. The main page show all available settings, each one leading to a page illustrating a different widget such as:
- button (with text or pictogram),
- label,
- scrolling list/text,
- scroll bar 
- wheel (with font zoom in/out),
- slider,
- radio button, 
- check-box, 
- switch, 
- progress bar, 
- horizontal/vertical lists.

This demo includes MicroEJ launchers configuration for the following Java platforms:
- MicroEJ simulator
- ST STM32F429I-EVAL
- ST STM32429I-DISCO

Each launcher can be configured in Run -> Run configuration... -> MicroEJ Application -> Widgets XXXX -> JRE: set VM arguments to the specific options values.
- `-Dmicroej.java.property.com.is2t.demo.NoLayer=SET` to deactivate the MicroUI layers in the transitions between pages.
- `-Dmicroej.java.property.com.is2t.demo.NoAnimation=SET` to deactivate the transition animations between pages.
By default, layers and transitions are enabled.

# Project Setup

First of all, you have to download the entire repository by using the `Download` button or by cloning the repository. After having retrieved the repository content, open MicroEJ and then import _Existing project into workspace_ by selecting either the ZIP file or the root directory.

## Requirements

- JRE 7 (or later) x86.
- MicroEJ 3.1 or later.
- Java platform with (at least): MICROUI-1.5, MWT-1.0, EDC-1.2, MICROUI-LAYER-2.0.0.
- Hardware: this demo has been tested on ST STM32F429I-EVAL (480x272 display) and STM32429I-DISCO (240x320 display) boards.

## Project structure

  - `src/`
  	- Java sources
  		com.is2t.demo.widgets.automaton: automaton of the demo.
  		com.is2t.demo.widgets.page: pages of the demo and flow management between page.
  		com.is2t.demo.widgets.theme: look and feel management of the demo.
  		com.is2t.demo.widgets.widget: specific widgets and renderers of the demo.
  		Widgets: entry point of the demo.
  	- Resources: images, fonts...
  - `launches/`: MicroEJ launches in the project `com.is2t.demo.widgets`
  - `lib/`: to access each library javadoc, open the <libraryname>-javadoc.jar (unzip)
  	- com.is2t.demo.utilities.jar: useful functions like automaton, colorhelper...
  	- com.is2t.demo.layers.jar: GUI layers management
  	- com.is2t.demo.transition.jar: specific transition library with layer
  	- ej.components.jar: component framework library
  	- ej.flow.jar: navigation management library
  	- ej.flow.mwt.jar: page navigation library
  	- ej.motion.jar: motion library 
	- widgets.jar: Widgets library
T

# Usage
To launch the application, right-click on the project, select _Run as_, _MicroEJ Application_ and choose _Widgets (Simulation)_. Another launcher is available to execute on the target board.

# Changes
- April 2015: initial version

# License
See the license file `LICENSE.md` located at the root of this repository.
These MicroEJ projects demonstrate MicroUI libraries features.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
16 April 2015
# Overview
This showroom application demonstrates MicroEJ UI libraries features.
For illustration: [video](http://www.youtube.com/watch?v=Wm-UgvCvTKI).

On start-up, the application starts the desktop. It contains several applications, each represented with an icon (picto). The applications are registered with the component framework (`ej.components`). Touch the picto to start the application. Go back to the desktop from any application by touching the home picto in the top right corner.  

Each application has an additional project .activor that is used by the component framework (`ej.components`) to add itself to the desktop (provide name, entry point, picto, how to start/top the application).

Some demos are using the MICROUI LAYERS library and requires a specific hardware acceleration for transparency to run smoothly. To run this demo on devices without hardware transparency acceleration,  

Available applications:

**Settings**: This demo represents a settings menu you can find on your smartphone. It demonstrates widgets like scrolling list/text, font zoom in/out, check-box, switch, progress bar, horizontal/vertical lists.
Screens left/right animations are configured to use the MICROUI-LAYERS library with fade in of the incoming screen (transparency 0 to 255) and fade out of the out-coming screen (transparency 255 to 0).
Project: `com.is2t.demo.settings`

**Graph**: This demo shows a curve representing randomly generated data. 
- You can affect the values manually by dragging the right cursor. 
- The colourized drawing below the curve can be dynamically disabled with one of the one board button.
- Touching the curve will stop it and display the current curve value of the touched area.
This demo uses the NLS library for the top messages in US and FR translations.
Project: `com.is2t.demo.graph`

**Domotic**: A simulation of a domotic application which can control the shutters, ligh and temperature in each room of an house. No source code are provided for this demo, only a .jar.
Project: `com.is2t.demo.domotic`

**Circular Progress Bar**: demonstrates a circular progress bar. Touch the setting value on the left to set the new value. The light value on the right will progressively reach this value.
Project: `com.is2t.demo.circularprogressbar`

**Elastic**: Elastic is a small game where the goal is to move the spider on the screen which can bounce against the wall depending from the speed. An anti-aliased line is drawn between your finger and the spider.
Project: `com.is2t.demo.elastic`

**Stretch**: The demos shows the deformation of an image.
Project: `com.is2t.demo.stretch`

**Desktop**: is the desktop for all applications. Holds the weather, date and clock widgets.
Project: `com.is2t.com.showroom`

Other projects:
- `com.is2t.fonts`: contains the common fonts used in the applications.
- `com.is2t.layers`: layers framework.
- `com.is2t.transition`: transition framework which use layers.
- `com.is2t.utilities`: various utilities.
- `com.is2t.widgets`: main widgets.

This demo includes MicroEJ launchers configuration for the following Java platform:
- simulator
- ST STM32F429I-EVAL
- Renesas RSK+RZA1H

Each launcher can be configured in Run -> Run configuration... -> MicroEJ Application -> Showroom XXXX -> JRE: set VM arguments to the specific options values.
- `-Dmicroej.java.property.com.is2t.demo.NoLayer=SET` to deactivate the layers in the transitions between pages.
- `-Dmicroej.java.property.com.is2t.demo.NoAnimation=SET` to deactivate totally the transitions between pages.


# Project Setup

First of all, you have to download the entire repository by using the `Download` button or by cloning the repository. After having retreived the repository content, open your MicroEJ and then import _Existing project into workspace_ by selecting either the ZIP file or the root directory.

## Requirements

- JRE 7 (or later) x86
- MicroEJ 3.1 or later
- Java platform with (at least): MicroUI1.5, MWT1.0, EDC1.2, EJ.COMPONENTS2.0, MICROUI LAYER 2.0.0, EJ.FLOW2.0, EJ.FLOW.MWT3.0, EJ.MOTION2.1
- Hardware: this demo has been tested on ST STM32F429I-EVAL (480x272 display) and Renesas RSK+RZA1H (800x480 display) boards.

## Project structure

Each project follows this structure:
  - `src/`
  	- Java sources
  	- Resources: images, fonts...
  - `launches/`: MicroEJ launches in the project `com.is2t.demo.showroom`

# Usage
To launch the application, right-click on the project, select _Run as_, _MicroEJ Application_ and choose _Showroom (Simulation)_ Another launcher is available to execute on the target board.

# Changes
- Dec 2014: initial version

# License
See the license file `LICENSE.md` located at the root of this repository.
This MicroEJ project presents how to compute and draw a gradient.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
16 April 2015
# Overview
This MicroEJ project presents how to compute and draw a gradient.

### Requirements
- JRE 7 x86 or later
- MicroEJ 3.0 or later
- A Java Platform with MicroUI 1.4 or later

### Project structure
- `src/`: Java sources
- `launches/`: MicroEJ launches
- `LICENCE.md`
- `README.md`

## Usage
- Launch MicroEJ.
- File->Import->General->Existing project into workspace: import Example-Gradient folder.
- To launch the application, right-click on the project, select _Run as_, _MicroEJ Application_ and choose _Show Gradient (Simulation)_.

## Changes
- Simple example.

## License
See the license file `LICENSE.md` located at the root of this repository.
This MicroEJ project presents how to parse XML in an embedded environment.
EXAMPLE for IOT
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
16 April 2015
# Overview
This eclipse project presents how to parse XML in MicroEJ environment. It details how to use **XML Pull** parsers such as **KXmlParser** and **MXParser**.

For more information about XML pull parsing, please refer to http://www.xmlpull.org.


### Requirements

- JRE 7 x86
- MicroEJ 3.0 at least

### Project structure

- `src/`
  - Java sources
  - XML resources
- `dist/`: when `build.ant` is called, a zip containing the project is created in this folder
- `launches/`: MicroEJ launches
- `lib/`: XML parsers libraries (available at http://www.xmlpull.org/impls.shtml)
- `build.ant`: ant build file meant to archive this project
- `LICENCE.md`
- `README.md`

### Configuration
Two different parsers are available: **KXmlParser** and **MXParser**. To switch between these parsers, open the build path (Right-click on the project, _Build Path_, _Configure Build Path_, _Libraries_), choose between `kxml2-2.3.0.jar` (KXmlParser) and `xpp3_min-1.1.4c.jar` (MXParser), remove the other one.

## Usage
To launch the application, right-click on the project, select _Run as_, _MicroEJ Application_ and choose _ReadPoem (Simulation)_. Another launcher is available to execute on the target board.

## Changes
- Simple example

## License
See the license file `LICENSE.md` located at the root of this repository.
This MicroEJ project presents how to test code.
EXAMPLE for MISC
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
16 April 2015
# Overview

This project is a Java Test Suite example for MicroEJ. The MicroEJ Test-Suite is an engine made for validating any development project using automatic testing. The MicroEJ Test-Suite engine allow the user to test any kind of projects within the configuration of a generic ant file.

The test suite output is created in a /results folder in xml and html format.

The MicroEJ test suite documentation can be found in the MicroEJ Platform Architecture User Manual in section Developments Tools -> Test Suite. This document can be viewed in MicroEJ Resource center view -> Manual.


## Project Setup

- Import the JavaTestSuite project in a MicroEJ workspace.
- This project comes with a default MicroEJ launchers (.launch) for the STM32F429IDISCO kickstart Java Platform. This can be changed in Run->run configuration->MicroEJ Application->Test 1: Execution -> Target JPF.
- Run->run configuration: MicroEJ Application->Test 1: click on Run
- Right click on the testsuite/javaTestsuite.xml->Run as-> Ant Build

### Requirements

- JRE 7(or later) x86
- MicroEJ 3.1 or later

### Project structure

- `src/`
  - Java sources
- `launch/`: MicroEJ launches
- testsuite/: the harness and Java test suite configuration
- `LICENCE.md`
- `README.md`


## Usage

Follow the instructions described in the MicroEJ Platform Architecture User Manual in section Developments Tools -> Test Suite.

## Changes

- Dec 2014: initial release

## License

See the license file `LICENSE.md` located at the root of this repository.

MicroUI Example

MicroUI example for UI/UX design.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
12 March 2015