Test with simulator multi application and shared interface


#1

Hi,

I create a multi application with shared interface.
I would like test but I don’t have a board yet.

Is there any possibility to test shared interface with simulator?

Thank you for your help


#2

Hi @Jvezolles,
There are two main way to run more than one application on the Simulator:

A) Add WPKs to Run configuration

This method allow you to add one or more applications WPK to be started at the beginning of the run.

Requirements

  • WPKs of additional applications to run (apart from the main application to run)

Method

  1. Drop all WPKs to a folder
  2. In MicroEJ SDK:
    1. Go to Run -> Run configuration
    2. Select the run configuration used to run the main application on the simulator
    3. Go to Configuration tab
      1. Go to Simulator -> Application
      2. Browse to folder where WPKs are
  3. Run

Limitation

  • The start can not be delayed (your main application will start after the WPKs)
  • No way to simulate a start/stop.

B) Use a Simulator project

This method uses a separate project to run multiple local projects

Requirements

  • The applications source code must be in the workspace

Method

  1. Create a new MicroEJ standalone project
  2. Add Eclipse project dependency to the applications project
  3. Create a new class with a main entry point
  4. Remove Eclipse *.resource filter in filters and customization
  5. In the main class call the generated Standalone entry point of the main application (found in the generated folders: src-generated)
  6. Create a new Thread for each background service of the secondary application
    1. Call the onStart and onStop when needed
  7. Create a Run configuration for the main class
    1. in the Execution tab
    2. Add resource to [secondaryApplicationId].services.system.properties (found in the generated folders: src-generated)

Limitation

  • Can not simulate two Activities
  • When calling the onStart and onStop of the background services, the state is not reset (any static variable will stay the same, any register service will stay as is)

Global Limiations

  • If a service is used by both applications (e.g. Timer), it will be shared
  • There aren’t any sandboxing in between application (no check of the types)

Regards,


#3

Thank you very much.
I use the option 2, it works very well, it’s exactly what I need.