In general your application should run without any changes inside applet.
"Save for Web..." function (in menu of main MicroEmulator application) does bytecode preprocessing of your application.
We are adding new class org.microemu.Injected to new JAR. Calls to System.getProperty(), System.out, System.err and getResourceAsStream are redirected to MicroEmulator Injected class.
The resulting JAR is safe to run on any other Emulator or device. Different Injected class with the same name is used when application is running under MicroEmulator.
MicroEmulator comes with three differend Skins:
Html fragment example for Default device:
<applet code="org.microemu.applet.Main"
width=226 height=471 archive="microemu-javase-applet.jar,(MIDlet application jar)">
<param name="midlet" value="(MIDlet application main class)">
</applet>There is additional parameter in the applet definition tag if you want to start the applet with device other than the default one:
<param name="device" value="(device main class or device.xml)">
Remember to include the new device jar into the applet archive tag
Example for SimpleDemo MIDlet, Nokia UI support and Minimum device:
<applet code="org.microemu.applet.Main"
width=157 height=285 archive="microemu-javase-applet.jar,microemu-nokiaui.jar,microemu-device-minimum.jar,microemu-demo.jar">
<param name="midlet" value="org.microemu.midp.examples.simpledemo.SimpleDemo">
<param name="device" value="org/microemu/device/minimum/device.xml">
</applet>Example for SimpleDemo MIDlet and Minimum device with mouse and color:
<applet code="org.microemu.applet.Main"
width=157 height=285 archive="microemu-javase-applet.jar,microemu-device-minimum.jar,microemu-demo.jar">
<param name="midlet" value="org.microemu.midp.examples.simpledemo.SimpleDemo">
<param name="device" value="org/microemu/device/minimum/device-color.xml">
</applet>Example for SimpleDemo MIDlet and Large Skin:
<applet code="org.microemu.applet.Main"
width=292 height=618 archive="microemu-javase-applet.jar,microemu-device-large.jar,microemu-demo.jar">
<param name="midlet" value="org.microemu.midp.examples.simpledemo.SimpleDemo">
<param name="device" value="org/microemu/device/large/device.xml">
</applet>Function MIDlet.getAppProperty(String) is extended with additional properties so your MIDP application can be made aware of applet runtime environment.
Example:
getAppProperty("demoServiceURL");
<applet code="org.microemu.applet.Main"
width=226 height=471 archive="microemu-javase-applet.jar,(MIDlet application jar)">
<param name="midlet" value="(MIDlet application main class)">
<param name="demoServiceURL" value="http://mycompany.com/appdemo/service.php">
</applet>