Dynamic Java hello world example
Introduction
This is an example that demonstrates how dynamic class loading works on
Lightfoot. Rather than use a web server or flash file to load the class
from, this example stores the bytes for the dynamically loaded
class in the image and uses a custom dynamic class loader to retrieve
the bytes when required.
Building the example
Change directory to the java hello dynamic example
cd %LF_HOME%\examples\java_hello_dynamic
Rebuild the application
lfmake clean all
In addition to a normal build, this example also does the
following.
- Compile the DynamicObject into a class file.
- Preverify the DynamicObject class file using the preverifier from
the Sun Wireless Toolkit
- Convert the class file into bytes suitable for use as a native
method in
Resources.java
- Enable dynamic class loading in the build.
Running the example
To run the example in the simulator
lf2debug sw hello.lfa
To run the example on the board
lfdownload hello.bin
Features
This example demonstrates the following SDK features.