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
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
- Drop all WPKs to a folder
- In MicroEJ SDK:
- Go to Run -> Run configuration
- Select the run configuration used to run the main application on the simulator
- Go to Configuration tab
- Go to Simulator -> Application
- Browse to folder where WPKs are
- 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
- Create a new MicroEJ standalone project
- Add Eclipse project dependency to the applications project
- Create a new class with a
main
entry point
- Remove Eclipse
*.resource
filter in filters and customization
- In the
main
class call the generated Standalone entry point of the main application (found in the generated folders: src-generated)
- Create a new Thread for each background service of the secondary application
- Call the onStart and onStop when needed
- Create a Run configuration for the
main
class
- in the Execution tab
- 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,
Thank you very much.
I use the option 2, it works very well, it’s exactly what I need.