 |
|
 |
Zaurus User Group FAQs (frequently-asked questions)
|
|
Category: Main -> Zaurus Java FAQ -> Packaging
Answer |
· How do I arrange sources/classes prior to packaging?
- Your sources can be packaged pretty much any way you fancy, hopefully keeping to the Sun naming convention for packages and classes ;-) Be sure to include all dependencies which aren't covered by the PersonalJava specification.
Compiling your classes should be done with a pre-Java 1.4 sdk, or using the -target 1.1 command line argument for the compiler to specify that compiled classes should follow the Java 1.1 class file structure (and version).
Your compiled classes should be contained in one or more jar files to save on space and filesystem clutter.
Back to top
|
· How do I package using the .ipk format?
- Packaging applications/applets for distribution and eventual use on a Zaurus is a painless task, using the ipkg-build tool1. Packaging your program starts by populating a predetermined directory tree structure with the appropriate files:
CONTROL
\_ <-- package control files
opt
\_QtPalmtop
|\_bin <-- application start script
|\_apps
| |\_Applications <-- application .desktop entry2
| |\_Games
| \_Settings
|\_java
| \_myapp <-- application jar (+html file for applets)
|\_etc
| \_myapp <-- application configuration files
|\_pics <-- application icon
| \_myapp <-- application image resources
\_help
\_en <-- application help files (english)
Please read this document to learn how to make an .ipk file package.
The java application start script cannot be passed command line arguments from the .desktop file and so must be self contained. It can be conceivably called anything you want. The current convention is to use the run prefix, eg: runSomeCommand
IMPORTANT
Your application does not have be installed in RAM, it could be installed on CF or SD media - this means that paths to resources must not be hard-coded. Thankfully, the Qtopia environment provides a means to find out where installation took place so that we can find our resources.
Your application image should be a 32x32 png file. Although you are free to name it anything, try to use a name which will associate it with your application. Qtopia will resize it as necessary for the taskbar.
Application configuration files are usually stored in a subdirectory of the etc directory such as etc/myapp.
Example .desktop file myapp.desktop
[Desktop Entry]
Comment=This is MY program
Exec=runmyapp
Icon=myappicon
Type=Application
Name=MyApplication
Example start script runmyapp
#!/bin/sh
#
# Change to the java directory where we're installed
cd ${PKG_ROOT}/opt/QtPalmtop/java
#
# Populate classpath with our application jar
CLASSPATH=somejar.jar
#
# Launch the virtual machine (using the -Xappname argument so that we appear
# on the tasklist - see Qtopia Integration section)
evm -cp $CLASSPATH -XappName=runmyapp mainClass
if launching an applet, substitute the last command with:
$QPEDIR/bin/evm -appletviewer myHtmlpage.html
Back to top
|
|
|
|
 |