Sandboxed Application Structure

Application Skeleton Creation

The first step to explore a Sandboxed Application structure is to create a new project.

First select File > New > MicroEJ Sandboxed Application Project:

Fill in the application template fields, the Project name field will automatically duplicate in the following fields.

A template project is automatically created and ready to use, this project already contains all folders wherein developers need to put content:

src/main/java
Folder for future sources;
src/main/resources
Folder for future resources (images, fonts etc.);
META-INF
Sandboxed Application configuration and resources;
module.ivy
Ivy input file, dependencies description for the current project.

Sources Folder

The project source folder (src/main) contains two subfolders: java and resources. java folder will contain all *.java files of the project, whereas resources folder will contain elements that the application needs at runtime like raw resources, images or character fonts.

META-INF Folder

The META-INF folder contains several folders and a manifest file. They are described hereafter.

certificate (folder)
Contains certificate information used during the application deployment.
libraries (folder)
Contains a list of additional libraries useful to the application and not resolved through the regular transitive dependency check.
properties (folder)
Contains an application.properties file which contains application specific properties that can be accessed at runtime.
services (folder)
Contains a list of files that describe local services provided by the application. Each file name represents a service class fully qualified name, and each file contains the fully qualified name of the provided service implementation.
wpk (folder)
Contains a set of applications (.wpk files) that will be started when the application is executed on the Simulator.
MANIFEST.MF (file)
Contains the information given at project creation, extra information can be added to this file to declare the entry points of the application.

module.ivy File

The module.ivy file describes all the libraries required by the application at runtime. The Ivy classpath container lists all the modules that have been automatically resolved from the content of module.ivy. See MicroEJ Module Manager for more informations about MicroEJ Module Manager.

Application Publication

Build the WPK

When the application is ready for deployment, the last step in MicroEJ Studio is to create the WPK (Wadapps PacKage) file that is intended to be published on a MicroEJ Forge instance for end users.

In MicroEJ Studio, right-click on the Sandboxed Application project name and select Build Module.

The WPK build process will display messages in MicroEJ console, ending up the following message:

[echo] project hello published locally with version 0.1.0-RC201907091602

BUILD SUCCESSFUL

Total time: 1 minute 6 seconds

Publish on a MicroEJ Forge Instance

The WPK file produced by the build process is located in a dedicated target~/artifacts folder in the project.

The .wpk file is ready to be uploaded to a MicroEJ Forge instance. Please consult https://community.microej.com for more information.