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:
- Folder for future sources;
- Folder for future resources (images, fonts etc.);
- Sandboxed Application configuration and resources;
- Ivy input file, dependencies description for the current project.
The project source folder (
src/main) contains two subfolders:
java folder will contain all
files of the project, whereas
resources folder will contain elements
that the application needs at runtime like raw resources, images or
META-INF folder contains several folders and a manifest file.
They are described hereafter.
- Contains certificate information used during the application deployment.
- Contains a list of additional libraries useful to the application and not resolved through the regular transitive dependency check.
- Contains an
application.propertiesfile which contains application specific properties that can be accessed at runtime.
- 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.
- Contains a set of applications (
.wpkfiles) that will be started when the application is executed on the Simulator.
- 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 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.
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
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.
.wpk file is ready to be uploaded to a MicroEJ Forge instance.
Please consult https://community.microej.com for more information.