 |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
Build Recipe: Windows Mobile | | | | |
< < | The following service packs and SDKs | > > | The following tools, service packs and SDKs | | | are needed for development with the CDC build system on Windows XP: |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
Build Recipe: Windows Mobile | | | Build System Setup
Required Developer Tools | |
< < | To use the CDC build system on a Windows XP host
is a Linux-like environment for Windows.
It includes a package management system
that allows libraries and applications
to be easily downloaded and upgraded.
The following Cygwin packages are necessary
for development with the CDC build system on Windows XP: | | | | | |
| |
< < | Microsoft Windows Visual Studio 2005 Standard Edition
is the standard tool suite for Windows development. | > > | Microsoft Windows Visual Studio
is the standard tool suite for Windows software development. | | | The following service packs and SDKs
are needed for development with the CDC build system on Windows XP: |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
| |
< < | CDC Build System: Windows Mobile | > > | Build Recipe: Windows Mobile | | | |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | The MIDP implementation is built on top of the functionality of Foundation Profile without exposing the APIs of Foundation Profile to applications.
For graphics functionality, the MIDP/LCDUI implementation is based directly on the Windows Mobile graphics layer. | |
> > | Note that the Personal Basis Profile implementation is not yet supported on Windows Mobile
and therefore xlet support is also not yet available. | | | The platform-dependent layer of the Windows Mobile implementation of phoneME Advanced is based on the Windows Mobile 5.0 Pocket PC SDK.
The runtime is compatible with both Windows Mobile 5 and 6.x. | |
< < | Required Developer Tools | > > | Build System Setup
Required Developer Tools | | | To use the CDC build system on a Windows XP host
is a Linux-like environment for Windows.
It includes a package management system | | | | |
< < | Required Project Components | > > | Required Project Components | | | After installing and updating the required developer tools for the CDC build system,
you can get the project source code | | |
| |
< < | Building Foundation Profile | > > | Building phoneME Advanced
Building Foundation Profile | | | With the required developer tools and project source code in place,
the next step is to create a driver script named build-fp.sh to run the build process. | | |
| |
< < | Building MIDP | > > | Building MIDP | | | And finally here's a build driver script named build-midp.sh for building MIDP: | | |
| |
< < | Using the Windows Mobile Device Emulator to Test the Executable | > > | Runtime Examples | | | After the build process successfully finishes, the CDC Java runtime environment
is available as runtime executable located in a few target directories, | | |
| |
< < | Two files are needed in addition to the CDC Java runtime environment executable files. | > > | (Optional).
Set the Device Emulator RAM size to 256 MB. | | | | |
< < | | | | | |
< < | A .lnk file launches the CDC Java runtime environment.
Note that paths used in the .lnk file
must be relative to the Storage Card root.
| > > | On the Device Emulator,
navigate to the File Explorer
application and select the Storage Card.
Foundation Profile Example
| | | | |
< < | An args.txt to contain the arguments for cvm.exe.
| > > | Create a .lnk file for launching the CDC Java runtime environment.
Note that paths used in the .lnk file
are relative to the Storage Card root. | | | For example, here is a basic test-fp.lnk file to launch cvm and run the HelloWorld application: | |
< < | 01#"\Storage Card\bin\cvm.exe" -f "\Storage Card\args.txt" | > > | 01#"\Storage Card\bin\cvm.exe" -f "\Storage Card\fp-args.txt" | | |
| |
< < | The fpargs.txt file should contain the following: | > > |
Create an args.txt file to contain the arguments for cvm.exe.
For example, the fp-args.txt file contains the following: | | | | |
< < | -Xmx2m -Djava.class.path="\Storage Card\testclasses.zip" HelloWorld? | > > | "-Xopt:stdioPrefix=\Storage Card" -Xmx2m "-Djava.class.path=\Storage Card\testclasses.zip" HelloWorld? | | |
| |
< < | Navigate to the File Explorer
application and select the Storage Card.
| | | Launch the HelloWorld application by double-clicking on the test-fp list item. | |
< < | | | | | |
< < | Since HelloWorld displays text on the standard output,
the results of this application are not immediately apparent.
Running a midlet is probably a more visually useful experiment
and this will be described next. | > > | HelloWorld displays text on the standard output,
so the results of this application are not immediately apparent.
To see the standard output of the HelloWorld application,
look at the OUT.txt file in the Storage Card directory.
MIDP Example
The example below is based on running a MIDlet locally. | | |
| |
< < | Create a .jar file containing a manifest file and a sample midlet. | > > | Create a .jar file containing a manifest file and a sample MIDlet . | | |
Copy the .jar file to the shared folder.
| |
< < | Create a .lnk file for the midlet. | > > | Create a .lnk file for the MIDlet. | | | It should be very similar to the .lnk file described in the previous example.
| |
< < | Create an args.txt file for the midlet: | > > | Create an args.txt file for the MIDlet: | | |
-Xmx2m -Dmicroedition.profiles=MIDP-2.1 -Dsun.midp.library.name=midp "-Dsun.midp.home.path=\Storage Card\midp\midp_wince" -Dcom.sun.midp.mainClass.name=com.sun.midp.main.CdcMIDletSuiteLoader sun.misc.MIDPLauncher -midppath "\Storage Card\midp\midp_wince\classes" -suitepath "\Storage Card\HelloWorld.jar" -1 HelloWorld | | |
Launch the .lnk file as in the previous example.
| |
< < | Using a Windows Mobile Device to Test the Executable
After testing with the Windows Mobile Device Emulator, testing with a Windows Mobile device is very straightforward.
Perform the same procedures as in the previous section and use the device to mount the shared directory instead of the device emulator. |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | These procedures are described in
Getting the Project Source Code. | |
< < | The required phoneME Advanced project components are: | > > | The required phoneME Advanced project components for building Foundation Profile are: | | | | |
< < | | > > |
The additional required phoneME Advanced project components for building MIDP are: | | | | |
< < | | > > |
The additional required phoneME Advanced project components for building an optional package are: | | | | |
< < | It is best to keep each of these component directories in the same top-level directory (e.g. C:/phoneme). | > > |
It's best to keep each of these component directories in the same top-level directory (e.g. C:/phoneme). | | | | |
> > | | | | Note:
The CDC build system has some dependencies on the way pathnames are used in a UNIX environment.
To make this work more smoothly in the Cygwin environment | | | $ mkdir /pmea
$ mount C:/pmea /pmea
| |
> > |
|
Note:
The following patches must be applied to the javacall directory:
|
| | | | |
< < | Build System Setup | > > | Building Foundation Profile | | | With the required developer tools and project source code in place,
the next step is to create a driver script named build-fp.sh to run the build process. | | |
| |
> > | | | | Note:
The Microsoft Visual Studio setup script | | |
$ export LIBPATH=
| |
> > | | | |
| |
> > | | | | Note:
The tools should be placed in the tools directory at the same level as the $TOP_DIR/cdc directory.
If the build script can't find the tools the you must set the TOOLS_DIR variable.
TOOLS_DIR=<location>/tools
| |
> > | | | |
| |
> > | | | | Note:
Running the build-fp.sh script should be done from the cdc/build/win32-arm-wm5 directory.
Adding | | | $ make -C $TOP_DIR/cdc/build/win32-arm-wm5 ... (rest of make command line)
instead. | |
> > | | | | | |
< < |
Note:
The following patches must be applied to the javacall directory:
| > > | Building MIDP | | | And finally here's a build driver script named build-midp.sh for building MIDP: | | |
| |
> > | | | | Note:
If you have problems with the build and need to start over, it's best to run make clean
before relaunching a failed build.
Some of the project components retain build state that needs to be cleaned out. | |
> > | | | |
Using the Windows Mobile Device Emulator to Test the Executable |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | |
#!/bin/sh
| |
< < | export TOP_DIR="C:/pmea" | | | make JDK_HOME=C:/j2sdk1.4.2_18 J2ME_CLASSLIB=foundation | | | instead.
| |
> > |
Note:
The following patches must be applied to the javacall directory:
| | | And finally here's a build driver script named build-midp.sh for building MIDP:
#!/bin/sh
| |
< < | export TOP_DIR="C:/pmea" | | | make JDK_HOME=C:/j2sdk1.4.2_18 | |
> > | J2ME_CLASSLIB=foundation | | | CVM_JIT=true CVM_PRELOAD_LIB=true | |
< < | CVM_INCLUDE_JAVACALL=true USE_JPEG=TRUE USE_MIDP=TRUE | > > | CVM_BUILD_SUBDIR_NAME=cdc-midp USE_JPEG=true USE_MIDP=true | | |
After modifying this script it can be invoked as follows: |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | | |
< < | Getting the Project Source Code | > > | Required Project Components | | | After installing and updating the required developer tools for the CDC build system,
you can get the project source code | | | These procedures are described in
Getting the Project Source Code. | |
> > | The required phoneME Advanced project components are:
- cdc
- javacall
- jpeg
- midp
- pcsl
- tools
It is best to keep each of these component directories in the same top-level directory (e.g. C:/phoneme).
Note: | | | The CDC build system has some dependencies on the way pathnames are used in a UNIX environment.
To make this work more smoothly in the Cygwin environment
you must mount the installation directory onto a top-level Cygwin directory. | | | $ mkdir /pmea
$ mount C:/pmea /pmea
| |
> > | | | | Build System Setup | | | export TOP_DIR="C:/pmea"
make | |
< < | CVM_DEBUG=true USE_VERBOSE_MAKE=true | | | JDK_HOME=C:/j2sdk1.4.2_18 J2ME_CLASSLIB=foundation CVM_JIT=true | | | export TOP_DIR="C:/pmea"
make | |
< < | CVM_DEBUG=true USE_VERBOSE_MAKE=true | | | JDK_HOME=C:/j2sdk1.4.2_18 | |
< < | J2ME_CLASSLIB=foundation | | | CVM_JIT=true CVM_PRELOAD_LIB=true | |
> > | CVM_INCLUDE_JAVACALL=true | | | USE_JPEG=TRUE USE_MIDP=TRUE
| | | The first task with using the device emulator
is to install the Java runtime environment within the emulator environment. | |
< < | While it is possible to use ActiveSync? to do this,
it is easier to use a shared folder. | | |
| |
< < | Create a Windows directory named "Storage Card"
and copy the CDC Java runtime environment executable files from the target build directory to the shared directory. | > > | Create a Windows directory named "Storage Card".
$ mkdir C:/Documents\ and\ Settings/User/Desktop/Storage\ Card
Copy the CDC Java runtime environment executable files from the target build directory to the shared directory. | | | This should include the bin and lib directories
and the testclasses.zip archive file.
| | | $ cp -r bin lib midp testclasses.zip /cygdrive/c/Documents\ and\ Settings/User/Desktop/Storage\ Card/
| |
> > |
Launch the Microsoft Device Emulator.
$ C:/Program Files/Microsoft Device Emulator/1.0/dvcemumanager.exe
| | |
| |
< < | Launch dvcemumanager.exe, the Microsoft Device Emulator.
By default, it is located in C:/Program Files/Microsoft Device Emulator/1.0. | > > | Select the shared folder. | | |
|
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | Note:
The Microsoft Visual Studio setup script | |
< < | /Program Files/Microsoft Visual Studio 8/Common7/Tools/vsvars32.bat | > > | C:/Program Files/Microsoft Visual Studio 8/Common7/Tools/vsvars32.bat | | |
defines the variable LIBPATH. This may cause the build to fail
because it tries search that path which is interpreted incorrectly since it is a Windows |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | and then build different versions of the CDC Java runtime environment
that will also run on a Windows Mobile/Pocket PC device or emulator. | |
< < | Note that the MIDP implementation is built on top of the functionality of Foundation Profile without exposing the APIs of Foundation Profile to applications. | > > | Platform Notes
The MIDP implementation is built on top of the functionality of Foundation Profile without exposing the APIs of Foundation Profile to applications. | | | For graphics functionality, the MIDP/LCDUI implementation is based directly on the Windows Mobile graphics layer. | |
> > | The platform-dependent layer of the Windows Mobile implementation of phoneME Advanced is based on the Windows Mobile 5.0 Pocket PC SDK.
The runtime is compatible with both Windows Mobile 5 and 6.x. | | | Required Developer Tools
To use the CDC build system on a Windows XP host
is a Linux-like environment for Windows. |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | and then build different versions of the CDC Java runtime environment
that will also run on a Windows Mobile/Pocket PC device or emulator. | |
> > | Note that the MIDP implementation is built on top of the functionality of Foundation Profile without exposing the APIs of Foundation Profile to applications.
For graphics functionality, the MIDP/LCDUI implementation is based directly on the Windows Mobile graphics layer. | | | Required Developer Tools
To use the CDC build system on a Windows XP host
is a Linux-like environment for Windows. | | | | |
< < | | | | | |
> > | | | | | | | are needed for development with the CDC build system on Windows XP: | |
< < | | > > | | | | | |
< < | | | | Getting the Project Source Code | | | you can get the project source code
by either downloading the project source code bundle (appropriate for evaluation purposes)
or checking out the project source code from the repository. | |
< < | | | | These procedures are described in
Getting the Project Source Code. | |
< < | Both the svn and wget
are available through the Cygwin package management system. | | | The CDC build system has some dependencies on the way pathnames are used in a UNIX environment.
To make this work more smoothly in the Cygwin environment
you must mount the installation directory onto a top-level Cygwin directory. | |
< < | For example, if the installation directory is C:/phoneme_advanced_mr2, | > > | For example, if the installation directory is C:/pmea, | | | then the following commands will mount the installation directory | |
< < | onto the top-level /phoneme_advanced_mr2 directory. | > > | onto the top-level /pmea directory. | | | It is important that the directory and the mount point have the same name. | |
< < | $ mkdir -p /phoneme_advanced_mr2
$ mount C:/phoneme_advanced_mr2 /phoneme_advanced_mr2 | > > | $ mkdir C:/pmea
$ mkdir /pmea
$ mount C:/pmea /pmea | | |
Build System Setup
With the required developer tools and project source code in place, | |
< < | the next step is to define a set of environment variables
that describe the location of the various developer tools.
Here is a template for an environment setup script named win-setup.sh
based on the default installation for the various developer tools.
It's best to keep this setup script
in the target build directory for Windows Mobile:
cdc/build/win32-arm-wm5.
It may be necessary to change the definitions of some of these locations. | > > | the next step is to create a driver script named build-fp.sh to run the build process.
The following script builds a basic Foundation Profile target: | | | | |
< < | #!/bin/bash | > > | #!/bin/sh | | | | |
< < | #
# set this paths for the Java SDK
#
export JDK_HOME=c:/j2sdk1.4.2_15 | > > | export TOP_DIR="C:/pmea" | | | | |
< < | #
# set these paths for MS Visual Studio
#
export VSROOT="/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio\ 8"
export VSROOT2="/cygdrive/c/Program Files/Microsoft Visual Studio 8"
export PATH=$VSROOT2/vc/ce/bin/x86_arm:$VSROOT2/Common7/IDE:$VSROOT2/VC/BIN:$VSROOT2/Common7/Tools:$VSROOT2/Common7/Tools/bin:$VSROOT2/VC/PlatformSDK/bin:$VSROOT2/SDK/v2.0/bin:$VSROOT2/VC/VCPackages:$PATH | > > | make CVM_DEBUG=true USE_VERBOSE_MAKE=true JDK_HOME=C:/j2sdk1.4.2_18 J2ME_CLASSLIB=foundation CVM_JIT=true CVM_PRELOAD_LIB=true | | | | |
< < | After modifying this script it can be executed in the current shell: | > > | After modifying this script it can be invoked as follows: | | | | |
< < | $ source win-setup.sh | > > | $ sh < build-fp.sh >& err & | | | | |
> > | | | | Note:
The Microsoft Visual Studio setup script | | |
$ export LIBPATH=
| |
> > | | | | | |
< < | Next, we'll need a driver script named build-fp.sh to run the build process.
The following script builds a basic Foundation Profile target:
#!/bin/bash
export TOP_DIR="/phoneme_advanced_mr2"
make \
J2ME_CLASSLIB=foundation \
CVM_JIT=true \
CVM_DEBUG=true \
CVM_PRELOAD_LIB=true
After modifying this script it can be invoked as follows:
$ sh < build-fp.sh >& err &
| > > | | | | Note:
The tools should be placed in the tools directory at the same level as the $TOP_DIR/cdc directory.
If the build script can't find the tools the you must set the TOOLS_DIR variable.
TOOLS_DIR=<location>/tools
| |
> > | | | | | |
< < | | > > | | | | Note:
Running the build-fp.sh script should be done from the cdc/build/win32-arm-wm5 directory.
Adding | |
< < | cd cdc/build/win32-arm-wm5 | > > | $ cd cdc/build/win32-arm-wm5 | | |
to the beginning of the build script to change to the directory automatically may fail.
If you want to cd to the build directory in the script use | |
< < | make -C $TOP_DIR/cdc/build/win32-arm-wm5 ... (rest of make command line) | > > | $ make -C $TOP_DIR/cdc/build/win32-arm-wm5 ... (rest of make command line) | | |
instead. | |
> > | | | | And finally here's a build driver script named build-midp.sh for building MIDP: | |
< < | #!/bin/bash | > > | #!/bin/sh
export TOP_DIR="C:/pmea" | | | | |
< < | export TOP_DIR="/phoneme_advanced_mr2" | | | make | |
> > | CVM_DEBUG=true USE_VERBOSE_MAKE=true JDK_HOME=C:/j2sdk1.4.2_18 | | | J2ME_CLASSLIB=foundation CVM_JIT=true | |
< < | CVM_DEBUG=true | | | CVM_PRELOAD_LIB=true | |
< < | PCSL_DIR=$TOP_DIR/pcsl USE_JPEG=true JPEG_DIR=$TOP_DIR/jpeg USE_MIDP=true MIDP_DIR=$TOP_DIR/midp | > > | USE_JPEG=TRUE USE_MIDP=TRUE | | |
After modifying this script it can be invoked as follows: | | | $ sh < build-midp.sh >& err &
| |
< < | Note that MIDP is built on top of the functionality of Foundation Profile.
For graphics functionality, the LCDUI implementation is based directly on the Windows Mobile graphics layer. | > > | | | | Note:
If you have problems with the build and need to start over, it's best to run make clean
before relaunching a failed build.
Some of the project components retain build state that needs to be cleaned out. | |
> > | | | | Using the Windows Mobile Device Emulator to Test the Executable |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | export VSROOT="/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio\ 8"
export VSROOT2="/cygdrive/c/Program Files/Microsoft Visual Studio 8" | |
< < | #
# Set these paths for MS Windows CE tools
#
export VS2005_CE_ARM_LIB="C:/Program\ Files/Windows\ CE\ Tools/WCE500/WINDOW~1.0PO/LIB/ARMV4I"
export VS2005_CE_ARM_INCLUDE="C:/Program Files/Windows CE Tools/wce500/Windows Mobile 5.0 Pocket PC SDK/Include/Armv4i"
export VS2005_CE_ARM_PATH="C:/Program\ Files/Microsoft\ Visual\ Studio\ 8/vc/ce/bin/x86_arm"
export VS2005_COMMON_PATH="C:/Program\ Files/Microsoft\ Visual\ Studio\ 8/vc/bin"
export VSINSTALLDIR=$VSROOT
export VCINSTALLDIR=$VSROOT/VC
export VS2005_ROOT=$VSINSTALLDIR
export VS8_DIR=$VSROOT2
export VS8_PATH=$VSROOT2
export VC_DIR=$VS8_DIR/VC
export VC_PATH=$VS8_PATH/VC | | | export PATH=$VSROOT2/vc/ce/bin/x86_arm:$VSROOT2/Common7/IDE:$VSROOT2/VC/BIN:$VSROOT2/Common7/Tools:$VSROOT2/Common7/Tools/bin:$VSROOT2/VC/PlatformSDK/bin:$VSROOT2/SDK/v2.0/bin:$VSROOT2/VC/VCPackages:$PATH |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | | |
< < | ActiveSync? 4.5 | > > | ActiveSync 4.5 | | | |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | Create an args.txt file for the midlet:
| |
< < | -Xmx2m -Dmicroedition.profiles=MIDP-2.1 -Dsun.midp.library.name=midp -Dsun.midp.home.path="\Storage Card\midp\midp_wince" -Dcom.sun.midp.mainClass.name=com.sun.midp.main.CdcMIDletSuiteLoader sun.misc.MIDPLauncher -midppath "\Storage Card\midp\midp_wince\classes" -suitepath "\Storage Card\HelloWorld.jar" -1 HelloWorld? | > > | -Xmx2m -Dmicroedition.profiles=MIDP-2.1 -Dsun.midp.library.name=midp "-Dsun.midp.home.path=\Storage Card\midp\midp_wince" -Dcom.sun.midp.mainClass.name=com.sun.midp.main.CdcMIDletSuiteLoader sun.misc.MIDPLauncher -midppath "\Storage Card\midp\midp_wince\classes" -suitepath "\Storage Card\HelloWorld.jar" -1 HelloWorld? | | | | |
> > | If you have problems launching the MIDlet you can add "-Xopt:stdioPrefix=/Storage Card" to args.txt to have output and errors written to the root of the storage card. | | |
Launch the .lnk file as in the previous example. |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | $ source win-setup.sh
| |
> > | Note:
The Microsoft Visual Studio setup script
/Program Files/Microsoft Visual Studio 8/Common7/Tools/vsvars32.bat
defines the variable LIBPATH. This may cause the build to fail
because it tries search that path which is interpreted incorrectly since it is a Windows
path with backslash characters. In that case simply set the variable to an empty string:
$ export LIBPATH=
| | | Next, we'll need a driver script named build-fp.sh to run the build process.
The following script builds a basic Foundation Profile target: | | | export TOP_DIR="/phoneme_advanced_mr2"
make J2ME_CLASSLIB=foundation | |
< < | USE_VS2005=true CVM_COMPILER_INCOMPATIBLE=false | | | CVM_JIT=true CVM_DEBUG=true CVM_PRELOAD_LIB=true | | | $ sh < build-fp.sh >& err &
| |
> > | Note:
The tools should be placed in the tools directory at the same level as the $TOP_DIR/cdc directory.
If the build script can't find the tools the you must set the TOOLS_DIR variable.
TOOLS_DIR=<location>/tools
Note:
Running the build-fp.sh script should be done from the cdc/build/win32-arm-wm5 directory.
Adding
cd cdc/build/win32-arm-wm5
to the beginning of the build script to change to the directory automatically may fail.
If you want to cd to the build directory in the script use
make -C $TOP_DIR/cdc/build/win32-arm-wm5 ... (rest of make command line)
instead. | | | And finally here's a build driver script named build-midp.sh for building MIDP: | | | export TOP_DIR="/phoneme_advanced_mr2"
make J2ME_CLASSLIB=foundation | |
< < | USE_VS2005=true CVM_COMPILER_INCOMPATIBLE=false | | | CVM_JIT=true CVM_DEBUG=true CVM_PRELOAD_LIB=true |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | $VSROOT2/SDK/v2.0/bin:$VSROOT2/VC/VCPackages:$PATH
| |
< < | After modifying this script it can be invoked as follows: | > > | After modifying this script it can be executed in the current shell: | | | | |
< < | $ . win-setup.sh | > > | $ source win-setup.sh | | |
Next, we'll need a driver script named build-fp.sh to run the build process.
The following script builds a basic Foundation Profile target: | |
< < | #!/bin/sh | > > |
#!/bin/bash | | | | |
< < | export TOP_DIR=`cygpath "/phoneme_advanced_mr2"` | > > | export TOP_DIR="/phoneme_advanced_mr2" | | | make J2ME_CLASSLIB=foundation USE_VS2005=true | | | And finally here's a build driver script named build-midp.sh for building MIDP: | |
< < | #!/bin/sh | > > | #!/bin/bash | | | | |
< < | export TOP_DIR=`cygpath "/phoneme_advanced_mr2"` | > > | export TOP_DIR="/phoneme_advanced_mr2" | | | make J2ME_CLASSLIB=foundation USE_VS2005=true |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | |
- Cygwin is a Linux-like environment for Windows with a package management system that allows libraries and applications to be easily downloaded and upgraded. The following Cygwin packages are necessary for development with the CDC build system on Windows XP:
| |
> > | | | | | |
< < | | > > | | | | | | | $ . win-setup.sh
| |
< < | Next, we'll need a driver script to run the build process. | > > | Next, we'll need a driver script named build-fp.sh to run the build process. | | | The following script builds a basic Foundation Profile target:
#!/bin/sh
| | | $ sh < build-fp.sh >& err &
| |
< < | And here's a build driver script for building MIDP: | > > | And finally here's a build driver script named build-midp.sh for building MIDP: | | |
#!/bin/sh | | | MIDP_DIR=$TOP_DIR/midp
| |
> > | After modifying this script it can be invoked as follows:
$ sh < build-midp.sh >& err &
| | | Note that MIDP is built on top of the functionality of Foundation Profile.
For graphics functionality, the LCDUI implementation is based directly on the Windows Mobile graphics layer.
Note:
If you have problems with the build and need to start over, it's best to run make clean
before relaunching a failed build. | |
< < | Some of the project components retain build state that needs to cleaned out. | > > | Some of the project components retain build state that needs to be cleaned out. | | | Using the Windows Mobile Device Emulator to Test the Executable |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | The following script builds a basic Foundation Profile target:
#!/bin/sh
| |
< < | export TOP_DIR=`cygpath "/mr2"` | > > | export TOP_DIR=`cygpath "/phoneme_advanced_mr2"` | | | make J2ME_CLASSLIB=foundation USE_VS2005=true | | |
#!/bin/sh
| |
< < | export TOP_DIR=`cygpath "/mr2"` | > > | export TOP_DIR=`cygpath "/phoneme_advanced_mr2"` | | | make J2ME_CLASSLIB=foundation USE_VS2005=true |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | The CDC build system has some dependencies on the way pathnames are used in a UNIX environment.
To make this work more smoothly in the Cygwin environment
you must mount the installation directory onto a top-level Cygwin directory. | |
< < | For example, if the installation directory is C:/mr2, | > > | For example, if the installation directory is C:/phoneme_advanced_mr2, | | | then the following commands will mount the installation directory | |
< < | onto the top-level /mr2 directory. | > > | onto the top-level /phoneme_advanced_mr2 directory.
It is important that the directory and the mount point have the same name. | | | | |
< < | $ mkdir -p /mr2
$ mount C:/mr2 /mr2 | > > | $ mkdir -p /phoneme_advanced_mr2
$ mount C:/phoneme_advanced_mr2 /phoneme_advanced_mr2 | | |
Build System Setup | | | before relaunching a failed build.
Some of the project components retain build state that needs to cleaned out. | |
< < | Using the Windows Mobile Emulator to Test the Executable | > > | Using the Windows Mobile Device Emulator to Test the Executable | | | After the build process successfully finishes, the CDC Java runtime environment
is available as runtime executable located in a few target directories, | | |
The fpargs.txt file should contain the following: | |
< < | -Djava.class.path="\Storage Card\testclasses.zip" HelloWorld? | > > | -Xmx2m -Djava.class.path="\Storage Card\testclasses.zip" HelloWorld? | | |
| | | Create an args.txt file for the midlet:
| |
< < | -Xmx2m -Dmicroedition.profiles=MIDP-2.0 -Dsun.midp.library.name=midp -Dsun.midp.home.path="\Storage Card\midp\midp_wince" -Dcom.sun.midp.mainClass.name=com.sun.midp.main.CdcMIDletSuiteLoader sun.misc.MIDPLauncher -midppath "\Storage Card\midp\midp_wince\classes" -suitepath "\Storage Card\HelloWorld.jar" -1 HelloWorld? | > > | -Xmx2m -Dmicroedition.profiles=MIDP-2.1 -Dsun.midp.library.name=midp -Dsun.midp.home.path="\Storage Card\midp\midp_wince" -Dcom.sun.midp.mainClass.name=com.sun.midp.main.CdcMIDletSuiteLoader sun.misc.MIDPLauncher -midppath "\Storage Card\midp\midp_wince\classes" -suitepath "\Storage Card\HelloWorld.jar" -1 HelloWorld? | | |
Launch the .lnk file as in the previous example.
\ No newline at end of file | |
> > | Using a Windows Mobile Device to Test the Executable
After testing with the Windows Mobile Device Emulator, testing with a Windows Mobile device is very straightforward.
Perform the same procedures as in the previous section and use the device to mount the shared directory instead of the device emulator. | | | \ No newline at end of file |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | Note that MIDP is built on top of the functionality of Foundation Profile.
For graphics functionality, the LCDUI implementation is based directly on the Windows Mobile graphics layer. | |
> > | Note:
If you have problems with the build and need to start over, it's best to run make clean
before relaunching a failed build.
Some of the project components retain build state that needs to cleaned out. | | | Using the Windows Mobile Emulator to Test the Executable
After the build process successfully finishes, the CDC Java runtime environment |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | and the testclasses.zip archive file.
| |
< < | $ cp -r bin lib testclasses.zip /cygdrive/c/Documents\ and\ Settings/User/Desktop/Storage\ Card/ | > > | $ cp -r bin lib midp testclasses.zip /cygdrive/c/Documents\ and\ Settings/User/Desktop/Storage\ Card/ | | |
| | | the results of this application are not immediately apparent.
Running a midlet is probably a more visually useful experiment
and this will be described next. | |
> > |
-
Create a .jar file containing a manifest file and a sample midlet.
-
Copy the .jar file to the shared folder.
-
Create a .lnk file for the midlet.
It should be very similar to the .lnk file described in the previous example.
-
Create an args.txt file for the midlet:
-Xmx2m -Dmicroedition.profiles=MIDP-2.0 -Dsun.midp.library.name=midp -Dsun.midp.home.path="\Storage Card\midp\midp_wince" -Dcom.sun.midp.mainClass.name=com.sun.midp.main.CdcMIDletSuiteLoader sun.misc.MIDPLauncher -midppath "\Storage Card\midp\midp_wince\classes" -suitepath "\Storage Card\HelloWorld.jar" -1 HelloWorld
-
Launch the .lnk file as in the previous example.
|
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | it is easier to use a shared folder.
| |
< < | Create a Windows directory named "Storage Card" and copy the appropriate CDC files into that directory. | > > | Create a Windows directory named "Storage Card"
and copy the CDC Java runtime environment executable files from the target build directory to the shared directory. | | | This should include the bin and lib directories
and the testclasses.zip archive file.
| |
> > |
$ cp -r bin lib testclasses.zip /cygdrive/c/Documents\ and\ Settings/User/Desktop/Storage\ Card/
| | |
Launch dvcemumanager.exe, the Microsoft Device Emulator.
By default, it is located in C:/Program Files/Microsoft Device Emulator/1.0.
| |
< < | Select the Windows Mobile 5.0 Pocket PC device emulator. | > > | Connect to the Windows Mobile 5.0 Pocket PC device emulator. | | |
On the emulator screen choose File->Configure. | |
< < | The Emulator Properties dialog displays. | > > | The Emulator Properties dialog will display. | | |
| |
< < | Under the Shared folder: edit box, select the 'Storage Card' directory you created. | > > | Under the Shared folder: edit box, select the newly created Storage Card directory. | | |
| |
< < | Click on the 'OK' button.
The folder is now shared. | > > | Click on the 'OK' button to share the directory. | | |
| | | 01#"\Storage Card\bin\cvm.exe" -f "\Storage Card\args.txt"
| |
< < | The args.txt file should contain the following: | > > | The fpargs.txt file should contain the following: | | |
-Djava.class.path="\Storage Card\testclasses.zip" HelloWorld
| |
< < | Since HelloWorld displays text on the standard output,
the results of this application are not immediately apparent.
So running a midlet is probably a more visually useful experiment. | | |
Navigate to the File Explorer
application and select the Storage Card.
| |
< < | Launch the HelloWorld application by starting test-fp. | > > | Launch the HelloWorld application by double-clicking on the test-fp list item. | | |
\ No newline at end of file | |
> > |
Since HelloWorld displays text on the standard output,
the results of this application are not immediately apparent.
Running a midlet is probably a more visually useful experiment
and this will be described next. |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | application and select the Storage Card.
| |
< < | Launch the Test application. | > > | Launch the HelloWorld application by starting test-fp. | | |
\ No newline at end of file |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | An args.txt to contain the arguments for cvm.exe.
| |
< < | For example, here is a basic test-fp.lnk file to launch cvm: | > > | For example, here is a basic test-fp.lnk file to launch cvm and run the HelloWorld application: | | |
01#"\Storage Card\bin\cvm.exe" -f "\Storage Card\args.txt"
| | |
-Djava.class.path="\Storage Card\testclasses.zip" HelloWorld
| |
> > | Since HelloWorld displays text on the standard output,
the results of this application are not immediately apparent.
So running a midlet is probably a more visually useful experiment. | | |
Navigate to the File Explorer |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | Required Developer Tools
To use the CDC build system on a Windows XP host | |
< < | requires three sets of developer tools:
| | | is a Linux-like environment for Windows.
It includes a package management system
that allows libraries and applications
to be easily downloaded and upgraded.
The following Cygwin packages are necessary
for development with the CDC build system on Windows XP: | |
> > |
- J2SE v 1.4.2 SDK
- Cygwin is a Linux-like environment for Windows with a package management system that allows libraries and applications to be easily downloaded and upgraded. The following Cygwin packages are necessary for development with the CDC build system on Windows XP:
| | |
-
- binutils
- bison
- flex
- gcc-g++
- make
| |
< < | | > > | | | | | |
> > | | | | | | | Both the svn and wget
are available through the Cygwin package management system. | |
> > | The CDC build system has some dependencies on the way pathnames are used in a UNIX environment.
To make this work more smoothly in the Cygwin environment
you must mount the installation directory onto a top-level Cygwin directory.
For example, if the installation directory is C:/mr2,
then the following commands will mount the installation directory
onto the top-level /mr2 directory.
$ mkdir -p /mr2
$ mount C:/mr2 /mr2
| | | Build System Setup
With the required developer tools and project source code in place, | | | #!/bin/bash
# | |
< < | # Set this path for Visual Studio | > > | # set this paths for the Java SDK | | | # | |
< < | VSROOT="C:/Program Files/Microsoft Visual Studio 8" | > > | export JDK_HOME=c:/j2sdk1.4.2_15 | | | # | |
< < | # Set this path for Windows Mobile 5.0 Pocket PC SDK | > > | # set these paths for MS Visual Studio | | | # | |
< < | WMROOT="C:/Program Files/Windows CE Tools/wce500/Windows Mobile 5.0 Pocket PC SDK" | > > | export VSROOT="/cygdrive/c/Program\ Files/Microsoft\ Visual\ Studio\ 8"
export VSROOT2="/cygdrive/c/Program Files/Microsoft Visual Studio 8" | | | | |
< < | export VS2005_CE_ARM_LIB="$WMROOT/Lib/ARMV4I"
export VS2005_CE_ARM_INCLUDE="$WMROOT/Include/Armv4i"
export VS2005_CE_ARM_PATH="$VSROOT/VC/ce/bin/x86_arm"
export VS2005_COMMON_PATH="$VSROOT/VC/bin"
VSROOT2=`cygpath "$VSROOT"`
export VS8_DIR="$VSROOT2"
export PATH=$VSROOT2/VC/ce/bin/x86_arm:$VSROOT2/VC/bin:$VSROOT2/Common7/Tools/Bin:$VSROOT2/Common7/IDE:$VSROOT2/Common7/Tools:$PATH | > > | #
# Set these paths for MS Windows CE tools
#
export VS2005_CE_ARM_LIB="C:/Program\ Files/Windows\ CE\ Tools/WCE500/WINDOW~1.0PO/LIB/ARMV4I"
export VS2005_CE_ARM_INCLUDE="C:/Program Files/Windows CE Tools/wce500/Windows Mobile 5.0 Pocket PC SDK/Include/Armv4i"
export VS2005_CE_ARM_PATH="C:/Program\ Files/Microsoft\ Visual\ Studio\ 8/vc/ce/bin/x86_arm"
export VS2005_COMMON_PATH="C:/Program\ Files/Microsoft\ Visual\ Studio\ 8/vc/bin"
export VSINSTALLDIR=$VSROOT
export VCINSTALLDIR=$VSROOT/VC
export VS2005_ROOT=$VSINSTALLDIR
export VS8_DIR=$VSROOT2
export VS8_PATH=$VSROOT2
export VC_DIR=$VS8_DIR/VC
export VC_PATH=$VS8_PATH/VC
export PATH=$VSROOT2/vc/ce/bin/x86_arm:$VSROOT2/Common7/IDE:$VSROOT2/VC/BIN:$VSROOT2/Common7/Tools:$VSROOT2/Common7/Tools/bin:$VSROOT2/VC/PlatformSDK/bin:$VSROOT2/SDK/v2.0/bin:$VSROOT2/VC/VCPackages:$PATH
| | | After modifying this script it can be invoked as follows: | | | Next, we'll need a driver script to run the build process.
The following script builds a basic Foundation Profile target: | |
< < |
#!/bin/sh
export TOP_DIR=`cygpath "C:/mr2/windows/source"` | > > | #!/bin/sh | | | | |
> > | export TOP_DIR=`cygpath "/mr2"` | | | make | |
< < | CVM_HOST_TOOLS_PREFIX=/usr/bin/ CVM_JAVA_TOOLS_PREFIX=`cygpath "C:/j2sdk1.4.2_15/bin/"` JDK_HOME=`cygpath "C:/j2sdk1.4.2_15"` | | | J2ME_CLASSLIB=foundation | |
< < | USE_VERBOSE_MAKE=true | | | USE_VS2005=true CVM_COMPILER_INCOMPATIBLE=false | |
< < | CVM_BUILD_SUBDIR=true CVM_BUILD_SUBDIR_NAME=phoneme-advanced | | | CVM_JIT=true | |
< < | CVM_OPTIMIZED=true CVM_PRELOAD_LIB=true CVM_SYMBOLS=true TOOLS_DIR="$TOP_DIR"/tools | > > | CVM_DEBUG=true CVM_PRELOAD_LIB=true | | |
After modifying this script it can be invoked as follows: | | |
#!/bin/sh
| |
< < | export TOP_DIR=`cygpath "C:/mr2/windows/source"` | > > | export TOP_DIR=`cygpath "/mr2"` | | | make | |
< < | CVM_HOST_TOOLS_PREFIX=/usr/bin/ CVM_JAVA_TOOLS_PREFIX=`cygpath "C:/j2sdk1.4.2_15/bin/"` JDK_HOME=`cygpath "C:/j2sdk1.4.2_15"` | | | J2ME_CLASSLIB=foundation | |
< < | USE_VERBOSE_MAKE=true | | | USE_VS2005=true CVM_COMPILER_INCOMPATIBLE=false | |
< < | CVM_BUILD_SUBDIR=true CVM_BUILD_SUBDIR_NAME=phoneme-advanced | | | CVM_JIT=true | |
< < | CVM_OPTIMIZED=true | > > | CVM_DEBUG=true | | | CVM_PRELOAD_LIB=true | |
< < | CVM_SYMBOLS=true TOOLS_DIR="$TOP_DIR"/tools ABSTRACTIONS_DIR="$TOP_DIR"/abstractions PCSL_DIR="$TOP_DIR"/pcsl | > > | PCSL_DIR=$TOP_DIR/pcsl | | | USE_JPEG=true | |
< < | JPEG_DIR="$TOP_DIR"/jpeg | > > | JPEG_DIR=$TOP_DIR/jpeg | | | USE_MIDP=true | |
< < | MIDP_DIR="$TOP_DIR"/midp CVM_INCLUDE_JAVACALL=false | > > | MIDP_DIR=$TOP_DIR/midp | | |
Note that MIDP is built on top of the functionality of Foundation Profile. | | | An args.txt to contain the arguments for cvm.exe.
| |
< < | For example, here is the basic test.lnk file to launch cvm: | > > | For example, here is a basic test-fp.lnk file to launch cvm: | | |
01#"\Storage Card\bin\cvm.exe" -f "\Storage Card\args.txt"
| |
< < | The args.txt file contains the following: | > > | The args.txt file should contain the following: | | | | |
< < | -Djava.class.path="\Storage Card\testclasses.zip" Test | > > | -Djava.class.path="\Storage Card\testclasses.zip" HelloWorld? | | |
|
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | And here's a build driver script for building MIDP: | |
< < | add stuff here | > > | #!/bin/sh
export TOP_DIR=`cygpath "C:/mr2/windows/source"`
make CVM_HOST_TOOLS_PREFIX=/usr/bin/ CVM_JAVA_TOOLS_PREFIX=`cygpath "C:/j2sdk1.4.2_15/bin/"` JDK_HOME=`cygpath "C:/j2sdk1.4.2_15"` J2ME_CLASSLIB=foundation USE_VERBOSE_MAKE=true USE_VS2005=true CVM_COMPILER_INCOMPATIBLE=false CVM_BUILD_SUBDIR=true CVM_BUILD_SUBDIR_NAME=phoneme-advanced CVM_JIT=true CVM_OPTIMIZED=true CVM_PRELOAD_LIB=true CVM_SYMBOLS=true TOOLS_DIR="$TOP_DIR"/tools ABSTRACTIONS_DIR="$TOP_DIR"/abstractions PCSL_DIR="$TOP_DIR"/pcsl USE_JPEG=true JPEG_DIR="$TOP_DIR"/jpeg USE_MIDP=true MIDP_DIR="$TOP_DIR"/midp CVM_INCLUDE_JAVACALL=false | | | | |
> > | Note that MIDP is built on top of the functionality of Foundation Profile.
For graphics functionality, the LCDUI implementation is based directly on the Windows Mobile graphics layer. | | | Using the Windows Mobile Emulator to Test the Executable
After the build process successfully finishes, the CDC Java runtime environment |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | is to install the Java runtime environment within the emulator environment.
While it is possible to use ActiveSync? to do this,
it is easier to use a shared folder. | |
< < |
- Create a Windows directory named "Storage Card" and copy the appropriate CDC files into that directory.
- Launch dvcemumanager.exe, the device emulator.
| > > |
-
Create a Windows directory named "Storage Card" and copy the appropriate CDC files into that directory.
This should include the bin and lib directories
and the testclasses.zip archive file.
-
Launch dvcemumanager.exe, the Microsoft Device Emulator.
| | | By default, it is located in C:/Program Files/Microsoft Device Emulator/1.0. | |
< < | | > > |
-
Select the Windows Mobile 5.0 Pocket PC device emulator.
| | | On the emulator screen choose File->Configure.
The Emulator Properties dialog displays. | |
> > |
| | | Under the Shared folder: edit box, select the 'Storage Card' directory you created. | |
> > |
| | | Click on the 'OK' button. | |
< < | | | | The folder is now shared. | |
< < | Next in Windows, create a .lnk file in the Storage Card directory
you just shared with the emulator to launch the CDC Java runtime environment.
The paths in the .lnk file need to be relative to the Storage Card root.
For example, to launch cvm: | > > |
Two files are needed in addition to the CDC Java runtime environment executable files.
-
A .lnk file launches the CDC Java runtime environment.
Note that paths used in the .lnk file
must be relative to the Storage Card root.
-
An args.txt to contain the arguments for cvm.exe.
For example, here is the basic test.lnk file to launch cvm: | | | | |
< < | 01#"\Storage Card\bin\cvm.exe" -Djava.class.path="\Storage Card" FontTest?
(NOTE:Make sure you do NOT use a drive letter prefix such as "C:\..." for the pathname of cvm.exe.
There are NO drive letters on Windows Mobile, only a leading back slash "\" to indicate starting from the toplevel of the Windows Mobile Device )
In the emulator, mount the build directory as a shared folder, use the File Explorer to navigate to the storage card, and click on the .lnk file.
* 255 character limit for .lnk files
NOTE: The limit for command line length in a .lnk file is 255 characters. If you need more than this, use the following in your link file: | | | 01#"\Storage Card\bin\cvm.exe" -f "\Storage Card\args.txt" | |
< < | (NOTE:Make sure you do NOT use a drive letter prefix such as "C:\..." for the pathname of cvm.exe. There are NO drive letters on Windows Mobile, only a leading back slash "\" to indicate starting from the toplevel of the Windows Mobile Device )
and create a file called args.txt. Put your command line arguments in this file. Here is an example of the formatting. Note that arguments with spaces need to be enclosed in double quotes.
-Xmx2m "-Dsun.midp.home.path=/Storage Card/midp/midp_wince" "-Dcom.sun.midp.main Class.name=com.sun.midp.main.CdcMIDletSuiteLoader" "-Xopt:stdioPrefix=\\My Documents" sun.misc.MIDPLauncher -suitepath "/Storage Card/HelloWorld.jar" "-1" "HelloWorld"
* Using option to add prefix to stdio:
"-Xopt:stdioPrefix=\\"
Ex.
"-Xopt:stdioPrefix=\\My Documents"
* You will also need to apply the following delta (this gets rid of the Could not read entire "-f" file error)
cdc/src/win32/bin/java_md.c on line 65, change
* fd = fopen(filename, "r"); to
* fd = fopen(filename, "rb");
* Create the following files in the root "\" or "\Storage Card" directory:
OUT.txt
ERR.txt
IN.txt
* Using the console
Use ccregedt.exe (in the CE Remote Tools directory, usually installed under Program Files) change the initial windows mobile registry settings. Change the HKEY_LOCAL_MACHINE/Drivers/Console/OutputTo to 0 to allow cvm to write to OUT/ERR files. This registry setting defaults to a non zero value which means "disallow" - the cvm won't be able to write any console output to the ERR/OUT files.
If you want to open a console (to see console output on the fly), from the emulator, choose File->configure. In the peripherals tab, you'll see a checkbox for "Create text console window for serial port 1". Check this. It will open a console window and you'll be able to see the vm output (and other output as well). Note that this only works with version 2 of the wm5 emulator (downloaded with the link earlier on this page) - this checkbox will not be enabled with the version of the emulator that comes with the sdk download.
* Possible crash
If you see a crash like this:
OEMIoControl?: Unsupported Code 0x1010058 - device 0x0101 func 22
OEMIoControl?: Unsupported Code 0x1010058 - device 0x0101 func 22
CertVerify?: \Storage Card\bin\cvm.exe trust = 2
OEMIoControl?: Unsupported Code 0x1010058 - device 0x0101 func 22
CertVerify?: \Storage Card\bin\cvmi.dll trust = 2
OEMIoControl?: Unsupported Code 0x1010058 - device 0x0101 func 22
CertVerify?: \Storage Card\bin\cvm.exe trust = 2
Data Abort: Thread=96b7674c Proc=814c7100 'cvm.exe'
AKY=00010001 PC=00f33504(cvmi.dll+0x00013504) RA=00f419a8(cvmi.dll+0x000219a8) B
VA=220001fc FSR=00000407
Do a soft-reset of the emulator.
* COMMAND LINE (In MS Visual Studio 2005, enter this line to the project setting [shortcut: Alt-F9] and then run the project)
-Xmx1m -Dsun.midp.home.path=/"Storage Card/midp/midp_wince" \
-Dcom.sun.midp.mainClass.name=com.sun.midp.main.CdcMIDletSuiteLoader \
sun.misc.MIDPLauncher -suitepath /"Storage Card/JBenchmark2.jar" -1 \
JBenchmark2.JBenchmark2 | > > |
The args.txt file contains the following:
-Djava.class.path="\Storage Card\testclasses.zip" Test
Navigate to the File Explorer
application and select the Storage Card.
Launch the Test application.
| | | \ No newline at end of file |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | add stuff here
| |
< < | Testing the Executable | > > | Using the Windows Mobile Emulator to Test the Executable
After the build process successfully finishes, the CDC Java runtime environment
is available as runtime executable located in a few target directories,
most importantly the bin and lib directories.
The Microsoft Device Emulator can be used to test the CDC Java runtime environment.
The first task with using the device emulator
is to install the Java runtime environment within the emulator environment.
While it is possible to use ActiveSync? to do this,
it is easier to use a shared folder.
- Create a Windows directory named "Storage Card" and copy the appropriate CDC files into that directory.
- Launch dvcemumanager.exe, the device emulator. By default, it is located in C:/Program Files/Microsoft Device Emulator/1.0.
On the emulator screen choose File->Configure.
The Emulator Properties dialog displays.
Under the Shared folder: edit box, select the 'Storage Card' directory you created.
Click on the 'OK' button.
The folder is now shared.
Next in Windows, create a .lnk file in the Storage Card directory
you just shared with the emulator to launch the CDC Java runtime environment.
The paths in the .lnk file need to be relative to the Storage Card root.
For example, to launch cvm:
01#"\Storage Card\bin\cvm.exe" -Djava.class.path="\Storage Card" FontTest
(NOTE:Make sure you do NOT use a drive letter prefix such as "C:\..." for the pathname of cvm.exe.
There are NO drive letters on Windows Mobile, only a leading back slash "\" to indicate starting from the toplevel of the Windows Mobile Device )
In the emulator, mount the build directory as a shared folder, use the File Explorer to navigate to the storage card, and click on the .lnk file.
* 255 character limit for .lnk files
NOTE: The limit for command line length in a .lnk file is 255 characters. If you need more than this, use the following in your link file:
01#"\Storage Card\bin\cvm.exe" -f "\Storage Card\args.txt"
(NOTE:Make sure you do NOT use a drive letter prefix such as "C:\..." for the pathname of cvm.exe. There are NO drive letters on Windows Mobile, only a leading back slash "\" to indicate starting from the toplevel of the Windows Mobile Device )
and create a file called args.txt. Put your command line arguments in this file. Here is an example of the formatting. Note that arguments with spaces need to be enclosed in double quotes.
-Xmx2m "-Dsun.midp.home.path=/Storage Card/midp/midp_wince" "-Dcom.sun.midp.main Class.name=com.sun.midp.main.CdcMIDletSuiteLoader" "-Xopt:stdioPrefix=\\My Documents" sun.misc.MIDPLauncher -suitepath "/Storage Card/HelloWorld.jar" "-1" "HelloWorld"
* Using option to add prefix to stdio:
"-Xopt:stdioPrefix=\\"
Ex.
"-Xopt:stdioPrefix=\\My Documents"
* You will also need to apply the following delta (this gets rid of the Could not read entire "-f" file error)
cdc/src/win32/bin/java_md.c on line 65, change
* fd = fopen(filename, "r"); to
* fd = fopen(filename, "rb");
* Create the following files in the root "\" or "\Storage Card" directory:
OUT.txt
ERR.txt
IN.txt
* Using the console
Use ccregedt.exe (in the CE Remote Tools directory, usually installed under Program Files) change the initial windows mobile registry settings. Change the HKEY_LOCAL_MACHINE/Drivers/Console/OutputTo to 0 to allow cvm to write to OUT/ERR files. This registry setting defaults to a non zero value which means "disallow" - the cvm won't be able to write any console output to the ERR/OUT files.
If you want to open a console (to see console output on the fly), from the emulator, choose File->configure. In the peripherals tab, you'll see a checkbox for "Create text console window for serial port 1". Check this. It will open a console window and you'll be able to see the vm output (and other output as well). Note that this only works with version 2 of the wm5 emulator (downloaded with the link earlier on this page) - this checkbox will not be enabled with the version of the emulator that comes with the sdk download.
* Possible crash
If you see a crash like this:
OEMIoControl?: Unsupported Code 0x1010058 - device 0x0101 func 22
OEMIoControl?: Unsupported Code 0x1010058 - device 0x0101 func 22
CertVerify?: \Storage Card\bin\cvm.exe trust = 2
OEMIoControl?: Unsupported Code 0x1010058 - device 0x0101 func 22
CertVerify?: \Storage Card\bin\cvmi.dll trust = 2
OEMIoControl?: Unsupported Code 0x1010058 - device 0x0101 func 22
CertVerify?: \Storage Card\bin\cvm.exe trust = 2
Data Abort: Thread=96b7674c Proc=814c7100 'cvm.exe'
AKY=00010001 PC=00f33504(cvmi.dll+0x00013504) RA=00f419a8(cvmi.dll+0x000219a8) B
VA=220001fc FSR=00000407
Do a soft-reset of the emulator.
* COMMAND LINE (In MS Visual Studio 2005, enter this line to the project setting [shortcut: Alt-F9] and then run the project) | | | | |
< < | After the build process successfully finishes, the Java runtime environment
is available as runtime executable located in a few directories. | > > | -Xmx1m -Dsun.midp.home.path=/"Storage Card/midp/midp_wince" \
-Dcom.sun.midp.mainClass.name=com.sun.midp.main.CdcMIDletSuiteLoader \
sun.misc.MIDPLauncher -suitepath /"Storage Card/JBenchmark2.jar" -1 \
JBenchmark2.JBenchmark2 |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
CDC Build System: Windows Mobile | | | Visual Studio 2005 SP1 | |
> > | | | | | | | It may be necessary to change the definitions of some of these locations. | |
< < | add stuff here
| > > | #!/bin/bash
#
# Set this path for Visual Studio
#
VSROOT="C:/Program Files/Microsoft Visual Studio 8"
#
# Set this path for Windows Mobile 5.0 Pocket PC SDK
#
WMROOT="C:/Program Files/Windows CE Tools/wce500/Windows Mobile 5.0 Pocket PC SDK"
export VS2005_CE_ARM_LIB="$WMROOT/Lib/ARMV4I"
export VS2005_CE_ARM_INCLUDE="$WMROOT/Include/Armv4i"
export VS2005_CE_ARM_PATH="$VSROOT/VC/ce/bin/x86_arm"
export VS2005_COMMON_PATH="$VSROOT/VC/bin"
VSROOT2=`cygpath "$VSROOT"`
export VS8_DIR="$VSROOT2"
export PATH=$VSROOT2/VC/ce/bin/x86_arm:$VSROOT2/VC/bin:$VSROOT2/Common7/Tools/Bin:$VSROOT2/Common7/IDE:$VSROOT2/Common7/Tools:$PATH | | | After modifying this script it can be invoked as follows: | | | Next, we'll need a driver script to run the build process.
The following script builds a basic Foundation Profile target: | |
< < | add stuff here | > > | #!/bin/sh
export TOP_DIR=`cygpath "C:/mr2/windows/source"`
make CVM_HOST_TOOLS_PREFIX=/usr/bin/ CVM_JAVA_TOOLS_PREFIX=`cygpath "C:/j2sdk1.4.2_15/bin/"` JDK_HOME=`cygpath "C:/j2sdk1.4.2_15"` J2ME_CLASSLIB=foundation USE_VERBOSE_MAKE=true USE_VS2005=true CVM_COMPILER_INCOMPATIBLE=false CVM_BUILD_SUBDIR=true CVM_BUILD_SUBDIR_NAME=phoneme-advanced CVM_JIT=true CVM_OPTIMIZED=true CVM_PRELOAD_LIB=true CVM_SYMBOLS=true TOOLS_DIR="$TOP_DIR"/tools | | |
After modifying this script it can be invoked as follows: | | | $ sh < build-fp.sh >& err &
| |
< < | Here's a build driver script for building MIDP: | > > | And here's a build driver script for building MIDP: | | |
add stuff here
| |
> > | Testing the Executable
After the build process successfully finishes, the Java runtime environment
is available as runtime executable located in a few directories. |
| |
| META TOPICPARENT | name="PhoneMEAdvanced" |
| |
< < | Windows Mobile | | | \ No newline at end of file | |
> > | CDC Build System: Windows Mobile
Building a CDC Java runtime environment for Windows Mobile
requires integration of the CDC build system
with conventional Windows Visual Studio developer tools.
The following sections show how to
setup the CDC build system on a Windows XP host platform,
and then build different versions of the CDC Java runtime environment
that will also run on a Windows Mobile/Pocket PC device or emulator.
Required Developer Tools
To use the CDC build system on a Windows XP host
requires three sets of developer tools:
- J2SE v 1.4.2 SDK
- Cygwin is a Linux-like environment for Windows. It includes a package management system that allows libraries and applications to be easily downloaded and upgraded. The following Cygwin packages are necessary for development with the CDC build system on Windows XP:
- binutils
- bison
- flex
- gcc-g++
- make
- subversion
- zip
- Microsoft Windows Visual Studio 2005 Standard Edition is the standard tool suite for Windows development. The following service packs and SDKs are needed for development with the CDC build system on Windows XP:
Getting the Project Source Code
After installing and updating the required developer tools for the CDC build system,
you can get the project source code
by either downloading the project source code bundle (appropriate for evaluation purposes)
or checking out the project source code from the repository.
These procedures are described in
Getting the Project Source Code.
Both the svn and wget
are available through the Cygwin package management system.
Build System Setup
With the required developer tools and project source code in place,
the next step is to define a set of environment variables
that describe the location of the various developer tools.
Here is a template for an environment setup script named win-setup.sh
based on the default installation for the various developer tools.
It's best to keep this setup script
in the target build directory for Windows Mobile:
cdc/build/win32-arm-wm5.
It may be necessary to change the definitions of some of these locations.
add stuff here
After modifying this script it can be invoked as follows:
$ . win-setup.sh
Next, we'll need a driver script to run the build process.
The following script builds a basic Foundation Profile target:
add stuff here
After modifying this script it can be invoked as follows:
$ sh < build-fp.sh >& err &
Here's a build driver script for building MIDP:
add stuff here
|
|
> > |
| META TOPICPARENT | name="PhoneMEAdvanced" |
Windows Mobile |
|