r75 - 14 Jan 2008 - 12:53:15 - GuilhermeCHazanYou are here: SuperWaba >  Main Web  > Faq
Big question mark By Guilherme C. Hazan. Thanks to Ed Crandell for the first revision.
Updated to SuperWaba 5.0 in January 31, 2005.

If you want to improve this Faq, just click the Edit button right down the bottom. To see your name in the contributors, you have to create a wiki account and login. Please try to find a convenient category to file your addition under. If still totally unsure, stick it in the unsorted section.

IMPORTANT NOTE: Some of the code presented has not been compiled, so it may contain syntax errors. If you find one, please let us know. Corrections and additional questions with answers should be sent to mailto:faq at superwaba.com.br
or, better than that, just edit this page and fix it! Thank you.

Note also that all questions here are valid for Palm OS, Windows CE or Pocket PC, Win32, and Applet-viewer or browser, unless otherwise specified.


Frequently Asked Questions

If you don't find your answers here, you can also look at the WabaSoft how-to papers which deal with the following topics:

  • Waba Installation Papers
    • Installing Waba on a PalmPilot
    • Installing Waba on a Windows CE Palm-sized PC
  • Waba Development Papers
    • Writing a Simple Program
    • Dealing with Performance
    • Dealing with Memory
    • Using Images and Timers
    • Working with Catalogs
    • Serial Port Communication
    • Color Images
    • Building the WabaVM for PalmOS
    • Building the WabaVM for Windows CE
    • Building the WabaVM for Windows NT/98/2000

These answers can be viewed at http://www.wabasoft.com/howto.shtml


Symbian OS

Question

Sometimes, when switching between containers, the focus gets lost.

Be sure that you always use Window.swap method (or its counterpart Container.swapToTopmostWindow). Try also to do this:

public void onStart() // called only once, at the first time the container is swapped
{
    onAdd();
    ...
}

public void onAdd() // called everytime the container is swapped into, except the first time
{
    setHighlighting();
}


Question

How can I install SuperWaba applications on Symbian S60v3 (E.G.: Nokia E61/62)

To be able to install SuperWaba VM and applications, don't forget to allow self-signed software installation as explained below:

Go to Application Manager (usually it is located under Tools folder). Select Options | Settings menu. When you select Software installation, you can see two options, i.e. Signed only and All. If you choose Signed only, you won't be able to install self-signed application. If you choose All, you will be able to install any signed applications


Question

How can I explore the directories in Symbian?

You can use this program: http://www.pushl.com/y_browser/


Question

How can i delete a task in Symbian?

You can use this program: http://www.pushl.com/taskspy/

Also, if you press and hold the "home" (also called menu or applications) key, a task switcher will appear.


How can i switch a task (or go back to the last SuperWaba program) in Symbian?

You press and hold the "home" key (also called menu or applications), and a task switcher will appear.


Question

Where are my application's data (and the DebugConsole?.txt file) stored in Symbian?

Here: <drive:>\system\apps\SuperWaba\<name of APP>


Question

Where are the SuperWaba files stored in Symbian?

The pdb files are here:
   <drive:>\system\apps\SuperWaba

The exe and dll files are here:
   <drive:>\sys\bin


Desktop Specific

Question

When I run my application in the desktop, lots of messages are shown in the console. How can I stop this?

You can hide most of the messages using this:

   if (!waba.sys.Settings.onDevice)
      waba.applet.JavaBridge.showMsgs = false;

Go to TOP- Sent by: guich@20021205


Question

How can I print out data when running on a desktop?

One way to do this is to create a file on the desktop, and then make a call to print the file from the command line (use Vm.exec, details in the SDK documentation).

HTML files can be printed like this:

rundll32.exe mshtml.dll,PrintHTML "c:\temp\allclasses-frame.html"
The nice thing about this command is that it will bring up the standard Microsoft Windows print dialog, which will allow users to select a different printer, etc.

An option for printing text files is to use notepad as follows:

notepad /p foobar.txt
This prints directly to the default printer.

Linux users can do a similar trick using kprinter or lpr to print the file. kprinter will bring up the printer dialog to print the specified file, lpr just prints the specified file to the default printer.

Go to TOP- Sent by: VikOlliver - 01 Mar 2004


Mac OS X Specific

Question

How can I program my Palm device in SuperWaba from Mac OS X?

To get you started, you can have a look at this step-by-step guide.

Go to TOP- Sent by: HadrienFlipouk - 7 Feb. 2007


Win32 Specific

Question

How can I print using the Win32 VM?

One way to do it is to create a file on the desktop, and then make a call to print the file from the command line (Vm.exec).

Examples of the command line:

HTML files can be printed like this:

rundll32.exe mshtml.dll,PrintHTML "c:\temp\allclasses-frame.html"

The nice thing about this command is that it will bring up the standard Windows print dialog, which will allow users to select a different printer, etc.

An option for printing text files under Windows is to use "notepad" as follows

notepad /p foobar.txt

This prints directly to the default printer.

Go to TOP- Sent by: hbhickman@20031208


Question

Is it possible to use the /scale option in Win32?

The /scale option, used in JDK, is not available in Windows 32. But you can use this workaround:

  • Copy the file SuperWabaSDK/lib/MSW2x.pdb (will be available in SuperWaba 4.01) to the folder where SuperWaba for Win32 is located (usually /SuperWaba).
  • Rename the current font file to .pd (E.g.: MSW.pdb ->MSW.pd)
  • When you run the program, pass these parameters: "/w 480 /h 640" in the command line, before the class name.That's it. You now have the "/scale 2" effect, but with a much nicer look.

Important: you can't keep the old MSW.pdb file in the same directory with the same .pdb extension, or the VM will get confused.

Go to TOP- Sent by: guich@20030816


Question

By default the win32 uses the wince 240x320 screen. Can I use the Palm OS, 320x320?

  • Copy the file SuperWabaSDK/lib/5SW.pdb to the folder where SuperWaba for Win32 is located (usually c:/SuperWaba).
  • Now, edit the link file to pass these parameters: "/w 320 /h 320" in the command line, before the class name.

Go to TOP- Sent by: guich@20071009


Palm OS Specific

Question

I get error code "Sys 0505(0,60)" when I try to start a SuperWaba application in the Palm OS 5 simulator.

You're using the debugging ROM. You must use the release ROM to be able to run SuperWaba applications on Simulator.

Go to TOP- Sent by: guich@20040925


Question

When I use POSE, I get a warning stating that SuperWaba has just written directly to the display or accessed the hardware registers. Why is this happening?

See below

Question

The Palm OS Emulator issued: SuperWaba just called Palm OS routine "SysSetTrapAddress"

In order to provide gray scale support for earlier versions of the PalmOS, the screen memory and hardware registers must be accessed directly, instead of through the more normal and safer calls provided by later versions of the PalmOS API. You must disable the following options in POSE (right click, Settings/Debuggin):

  • Hardware Register Access
  • Proscribed Function Call
  • Screen AccessNote? that when the other warnings occur, it generaly indicates a bug in the SWVM. Contact us so we can solve the problem.

    Go to TOP- Sent by: crandell@20010627


Question

Can I use the Palm OS native keyboard instead of the one provided in SuperWaba?

Unfortunately, no. SuperWaba applications can't have access to native controls. That's why SuperWaba provides a different keyboard. There's an advantage to this: we can offer new controls, more customizable than the native controls. For example, Palm OS controls don't have a disabled state. Anyway, you can always create your own keyboard, trying to mimic the native one.

Go to TOP- Sent by: guich@20030117


Question

I have my Palm in the cradle. How can I open a socket connection from it?

You have three choices:

  1. Use superwaba.ext.xplat.io.SerialSocket and SerialSocketServer classes. These classes are for Serial connection only. For USB, Linux will handle it correctly, but in Windows you'll need a usb-to-serial cable.
  2. On Linux, configure a Palm PPP connection direct to the PC. On the Linux box use as root: /usr/sbin/pppd /dev/pilot 19200 192.168.11.2:192.168.11.1 proxyarp passive silent persist local noauth
  3. On Windows 98 use the MochaPPP software. But this software is paid.
  4. Windows 2000 and XP both have a built in PPP capability through the serial cable! This is really cool because it allows you to connect your palm to the LAN/internet through a serial cable without having to recode for a different Socket class, since it will use the normal Palm socket code. I found instructions for setting all this up at this URL: http://bwinton.latte.ca/Palm/ppp.html. These instructions are for connecting a Tivo device to Windows XP via a serial cable, but they work just as well for a Palm device (I tested it with Windows 2000 and a Symbol device running Palm OS 3.5 and it worked perfectly). You will have to set up a network connection from the Palm Preferences app to use PPP over direct serial. The neat thing about this particular solution is that since you have a real TCP/IP connection through the serial cable, you can setup your Hotsynch manager to do a Network hotsynch, and then configure the hotsynch app on the Palm device to do a LAN synch to the IP of your machine. This allows you to do both a regular hotsynch and TCP/IP functionality from the device in the serial cradle without stopping/starting the PPP server and/or hotsynch manager.

Go to TOP- Sent by: SirAnodos?@20021205

Question

Why can't I open a socket, even when I follow the sample code in the documentation?

Waba and SuperWaba will not allow you to open a socket before the main event handling loop has started. The problem is discussed in more detail in theWaba FAQ. The solution is to open the socket outside of your application's MainWindow? constructor and after the onStart method. A good place is in the onWindowPaintFinished method.

Go to TOP- Sent by: crandell@20011011


Question

When I try to read a value from a socket using POSE, my code runs fine, but when I run it on an actual handheld, it always returns a count of zero bytes read. How can this be fixed?

Put the socket.readBytes statement in a loop until either the count is greater than 0 or a predetermined amount of time has past. solution posted in newsgroup by

Go to TOP- Sent by: PeterCarroll?@20010627


Question

When I beam my Waba app to another Palm device it doesn't work. Whats wrong?

Beaming apps does exactly that: It beams only the app's prc files, not its pdb files. Usually, a SuperWaba app consists of 4 files: SuperWaba.prc/.pdb, and YourApp?.prc/.pdb. You are only beaming Waba.prc/YourApp.prc. To beam all, you will need a utility such as the excellent BeamBox? or Filez programs.
Get it at http://www.palmgear.com

Go to TOP- Sent by: guich@20010203


Question

What's the minimum Palm OS requirements for running SuperWaba?

SuperWaba runs perfectly in Palm OS 3.0 and above. Palm OS 2.0 support was dropped on version 4.1 due to library's size.

Go to TOP- Sent by: guich@20010203


Question

How can I create a conduit in Palm?

A good place to start on conduits is here:http://www.palmos.com/dev/tech/conduits/

Go to TOP- Sent by: guich@20010203


Question

How can I open the USB port in my Palm with waba.io.SerialPort?

First of all, some words about USB and the features of your Palm. USB defines basically two types of devices that can be connected to the bus, host (master, usually a PC) and peripheral (slave, for example a printer). In each USB bus, one and only one host device at any time must exists, while there may be any number (max. 127) of peripheral devices connected at the same time to the same bus. Starting from revision 2.0 of USB standard, a new device type has been defined, named On The Go (OTG), which has the ability to become a bus master when it's connected to a bus with only peripherals, or a slave when another master is up and running.
The Palm is a USB peripheral, that means it needs to be connected to a bus where a host device is present, like a PC or a OTG device.
To communicate with such devices, it's possible to use the waba.io.SerialPort class, but in your java code, you have to open a specific port when you instantiate this class, that's the port number 0x8004. Using this constant in your code, you can open the USB port of your Palm for a generic connection, and all you need now is to implement a simple "driver" for the devices you want to communicate with, layered above the waba.io.SerialPort class.
This workaround has been tested on: Palm M515, Palm Zire21.

Go to TOP- Sent by: MassimilianoFrancario? - 11 May 2004


Bitmap Problems

Question

Showing 64k color bitmaps and Jpegs

We had added support for 16 bpp images for Jpegs. This lead to some changes in the virtual machine which could lead to old programs being breaked due to memory problems.

Remember the strange palette problems that occured in devices such as zire 71 and new Tungstens? How can an image with 256 colors lead to problems in a 16bpp device?

The answer is simple: although the device had 64k colors (16bpp), it is switched to 8bpp mode most of the time!

Why Palm OS uses 8bpp with 16bpp devices? Two reasons:

1. 16bpp mode consumes more power 2. 16bpp mode consumes the double of memory.

E.g.: 320x320x8bpp requires 100kb, while 320x320x16bpp requires 200kb. This is used, for example, when you open a Menu, or a popup window.

So, to enable 16bpp in your programs, you must now use a special command line to Exegen: /16

This tells PalmOS5?_or_16bpp devices that it should switch to a 16bpp screen if one is available.

There's a new flag: Settings.isHighColor (16bpp). Even if you're running in a 16bpp device without the /16 switch, it will return false.

Conclusion: If your program uses lots of images, use the /16 parameter option in Exegen, and THOROUGHLY TEST YOUR PROGRAM IN THE TARGET DEVICE, opening all windows and menus available.

Go to TOP- Sent by: guich@20040401


Question

What is the maximum size of a bmp that i can use?

Since pdb records are limited to 64k, thats it: 64k. Also, everything in SuperWaba is limited to 64kb (well, not exactly 64kb, but 65500 bytes).

Go to TOP


Question

Having problems when loading bitmaps?

Sometimes when you try to load an image, you get "OutOfMemory In imageLoadBmpCompressed". This happens because images require a very big piece of memory. For example, suppose a 120x120 bitmap:

1bpp (black/white): 120*120/8 = 1800 bytes 4bpp (16 colors) : 120*120/2 = 7200 bytes 8bpp (256 colors) : 120*120 = 14400 bytes.

So, a 320x320x8bpp takes almost 102kb!

The PDAs have a limited memory for everything, including images. So, loading lots of images can lead to problems.

To bypass this problem, load only the images you're going to use, and try to decrease the color depth whenever possible (try to use IrfanView - a great free image converter). Be also always sure to use the web-safe-palette, or even the same colors in all 16 color images, or you'll have color problems.

Go to TOP- Sent by: guich@20031208


Question

How can I create an offscreen bitmap, write it to a catalog and get it back?

Please see examples/DrawingControl for an example.

Go to TOP- Sent by: guich@20010203


Question

What kind of images can I display in SuperWaba?

Currently, you can add 1/2/4/8 bits per pixel images to your app. It must be a bitmap in the .bmp file format, compressed or not. Jpg, Gif and PNG are allowed if you purchase the Professional Subscription at the site. 24bpp bitmaps are not allowed.

Go to TOP- Sent by: guich@20010203


Question

How do I save and load bitmaps?

Please see superwaba\samples\ui\painter example.

Go to TOP- Sent by: guich@20060417


Question

Whats the difference between DRAW_REPLACE_COLOR and DRAW_SWAP_COLORS?

Let's say you have a 256 color bitmap.

1. If you want to change one color by another color, use DRAW_SWAP_COLORS. EG: you can swap all red pixels with a purple color.

2. If you want to change all colors to another color BUT preserving one, use DRAW_REPLACE_COLOR. EG: you can preserve the red pixels while replacing all the other 255 colors with purple.

Go to TOP


Question

I'm declaring the colors to use in my application but they appear strange (sometimes even Pink!)

Are you using something like this?

   //Pink borders on everything
   static final Palette PAL = new Palette();
   static final Color WIN_COLOR = PAL.getColor(0x1E);
To avoid it, remove the static keyword:
   // No pink borders
   final Palette PAL = new Palette();
   final Color WIN_COLOR  = PAL.getColor(0x1E);

Another possible problem is that a number of images are being used with different palettes. Some PDAs can only support a small range of colours, and when they get re-used things can turn ugly. The trick is to use the same palette for all images where possible.

Here's what to do to fix it:

Load your image into The Gimp (either the Windows or Linux version) and find out how big it is ( Right-click, Image, Scale Image ).

Take an image from the SuperWabaSDK like ./samples/game/Ping/hockey.bmp and load it into The Gimp.

Resize the image ( Right-click, Image, Scale Image again) to the size you want. You will need to click on the little chain linking the X & Y ratio to scale it unevenly.

Take your image, copy it ( Ctrl-A, Ctrl-C ) over the sample image ( Ctrl-V, Ctrl-H) and save the resulting image as a new .BMP file. Use the new file happily in SuperWaba.

Go to TOP- Sent by: MarkGonsalves?@20021205


Runtime Problems

Question

I'm getting out of memory problems, saying i can't allocate more than 64k. Can i increase this limit?

SuperWaba already uses all the available memory of the PDA (in Palm OS, even more than the available). It also has a limit of 65500 bytes for any kind of object allocated. This means that a String must have a max of 32750 chars (each char is 2 bytes length), and that no single class file can have more than 65500 bytes.

If you have to read a file from somewhere, consider using the BigByteArrayStream class (available in the Professional SDK), which can read a file of any size.

Go to TOP- Sent by: guich@20080114


Question

I'm getting strange results with float and double. What's wrong?

Computers in general cannot represent all numbers in an exact way, due to limited space available for the precision. So, 1.1 maybe isnt stored as 1.1, but as 1.099999999. That's why sometimes you don't get the exact result as you expected. This is more critical with float (32-bit) datatypes: try to store something like 54321.12345, read the result back: you'll find that the value has changed. Double values use 64 bits, but this does not mean that all problems are gone. The general rule is: do not expect that floating point values are exact. For example, 2.0 % 0.1 == 0 will led to false in most places (even in your Pentium IV machine). Instead, check if 2.0 % 0.1 < 0.00001, then you'll get the correct result. For more information, see this and this.

Go to TOP- Sent by: guich@20031120


Question

What do the GC beeps mean?

When you run the Welcome app (clicking on SW VM icon), there's a VM menu option. By enabling the "Audible GC" option, you will start to hear some beeps every time the Garbage Collector (GC) is called. There are four kinds of beeps (here are the frequencies, lower frequency = deeper sound),

  • 2000: the GC is Starting
  • 2200: the GC is Ending
  • 1300: a memory dump occured
  • 1000: a timed chunk was created

Go to TOP- Sent by: guich@20030720 modified by VikOlliver - 23 Oct 2003


Question

What is the memory dump created when an app exits?

When you run the Welcome app (clicking on SW VM icon), there's a VM menu option. If you enable the "Dump Memory Stats", the VM will dump some memory statistics each time a program exits. By lowering the numbers, you can make your app run faster (PRO subscribers have the Optimization Tricks Tutorial included in the SuperWaba Companion.pdf tutorial). For more information, see SuperWaba.c

There's also a hidden way to dump the stats during the program's run: enter @?@ anywhere (the keystrokes are handled by the VM).

Here's the dump and the meanings. Terminology: a chunk is a block of memory (16Kb) that stores objects.

  • Memory Statistics for class that extends MainWindow?
  • Times GC was called: number of times the GC was called by the program
  • Total GC time: total time used by the GC
  • Times Compact was called: number of times the chunk compactation is called. Note: compactation means that two or more consecutive collected objects were joined to form a bigger object
  • Total Compact time: total time used by the compactation process
  • Times Compact succeed: number of times that compactation could really compact something
  • Times Delete was called: numer of times unused chunks were released to the system
  • Total Delete time: total time used by the delete chunk process
  • Total Obj Allocated: number of bytes used by all created chunks
  • Max Obj Allocated: maximum number of bytes allocated. The number of bytes can shrink when chunks are deleted
  • Currently used: number of bytes allocated by objects in use
  • Total Class mem: number of bytes used to hold class information
  • Chunks created: number of chunks created
  • Timed chunks created: number of timed chunks created. Each time an app calls the GC two times before 2000ms, a timed chunk is allocated (this avoids keep calling the GC when a program is doing lots of object creations)
  • Chunks deleted: number of chunks deleted
  • Calling GC...: Here the VM calls the GC
  • Total Obj Allocated: number of bytes used by all created chunks after this last GC
  • Currently used: number of bytes allocated by objects in use after this last GC
  • Chunks deleted: number of chunks deleted after this last GC

Go to TOP- Sent by: guich@20030720


Hardware Specific

Question

Which devices are compatible with SuperWaba?

We maintain a list of SupportedDevices.
If you were able to run SuperWaba on a device not yet listed, please update the page to share the information with the SuperWaba community, thanks.

Go to TOP- Sent by: guich@20030514


Question

Is there a method for getting the ROM serial number?

Starting in SuperWaba 4.21, yes. See Settings.romSerialNumber.

Go to TOP- Sent by: dodah12@20031111


SuperWaba Background Info.

Question

Are there any benchmark comparision between SuperWaba and Waba?

Yes. By running the examples/Bench program running in a Palm Professional, here are the results (for SuperWaba x Waba), time measured in Milliseconds:

Graphics+Native methods Loop Field Method Array String + GC Total
Waba 1.0b 143010 33340 8860 25940 126460 53250 390860
SuperWaba 3.21 62920 21240 4030 11260 44500 18950 162900

Go to TOP - Sent by: guich@20010203


Question

Can I run both Waba and SuperWaba in the same handheld?

Yes. SuperWaba uses a different creator id from Waba, so they can live together. Note also that this difference makes impossible to run a Waba application with SuperWaba, unless you recompile and repackage the application.

Go to TOP- Sent by: guich@20010203


Question

"Bad opcode" error when running my SuperWaba app...

SuperWaba doesn't support a few opcodes of java, like the synchronized keyword and also breakpoints. So, make sure you are not using them.

Go to TOP- Sent by: guich@20010203


Question

What are the pros and cons of porting a Satellite Forms application to SuperWaba?

Message sent by Kambiz Darabi to the newsgroup:

I have almost finished porting a former SF app to Superwaba and I have experience in SF programming since 1998.

The speed is not a real issue apart from one single point: when you do case insensitive text searches in databases. There, you have a great performance difference between SF (native code) and SW (Java code).

This is the bad news.

But now the good news: there is already a native Catalog Search Library, which gives searches a performance boost.

And in general: if you have a task which has a bad performance in SW, you can always create a native library which would do the job much quicker. You would have to take the critical methods and port them to C.

Now for another comparison: If you have a moderately complex application and use the Visual Basic type of approach of SF, you have to be very very careful about your software development process. Your business logic is scattered in dozens of "onButtonClicked" and "onValidate" etc. functions in your different "Forms" and there is a good chance of getting into trouble because of side effects of changing global vars etc.

In SW, you can take full advantage of the object oriented approach: you can put your business logic into some distinct classes; you can use a model-view-controller pattern to always keep GUI, data, and business logic separate; you can create re-usable graphical and non-graphical objects which can be quickly reprogrammed; you can use javadoc to document the functionality of your classes; you can use a code repository for team development (e. g. CVS) ... I could go on with this forever, as I'm very enthusiastic about Java after having programmed in different machine languages, Basic, Pascal, Prolog, Lisp, Tcl, C, C++ ... smile

I would personally never, never go back to Satellite Forms.

Go to TOP- Sent by: KambizDarabi@20021205


Question

I want to port my program from Waba 1.0 to SuperWaba. Is this easy?

Sure! SuperWaba is 99% compatible with Waba. These are the 1% incompatibilities:

  • Tab and TabBar? classes were removed. Use TabPanel? instead.
  • Graphics constants used in the setDrawOp method: the names had changed (and some new operation was added). Use this convertion: DRAW_OVER ->DRAW_PAINT; DRAW_AND ->DRAW_ERASE; DRAW_OR ->DRAW_OVERLAY; DRAW_XOR ->DRAW_INVERT.
  • Some VM methods has been removed and has been transformed into public static fields:
    • getPlatform ->Use Settings.platform or Settings.onDevice
    • getRomVersion ->Use Settings.romVersion
    • getUserName ->Use Settings.userName
    • getVersion ->Use Settings.version or Settings.versionStr
    • isColor ->Use Settings.isColor
  • The File class has been removed. It will be added in the future to handle the plugin cards file system. You can use the Catalog class now in both Windows and Palm OS devices.
  • The Warp and Exegen programs are now a normal Java program (no more a Windows .exe), so you'll need java.exe to execute them. Take a read at the instructions for both. Exegen now uses a different creator id for SuperWaba programs, so you must install a new PRC file replacing the one created with Waba. Also, in Windows CE there's no more WRP files: you must install the same PDB files used in Palm OS.Take a look at this faq. It has answers to other porting questions too.

Go to TOP- Sent by: guich@20021206


Question

How can I add native methods to SuperWaba?

There is a specific tutorial for this: The SuperWaba Library Tutorial, that is included in the SuperWaba Companion.pdf file available in the PROFESSIONAL subscription SDK. If you are unable to afford the meagre price of the tutorial, then look at the scanner library as an example.

Go to TOP- Sent by: guich@20010203


Question

What are the differences between SuperWaba and J2ME ?

Please check the SuperWaba site, menu PLATFORM / FEATURES.

Go to TOP- Sent by: guich@20031110


Question

I can't access pilot.programmer.waba using a newsgroup reader. Can't I post messages from the Internet?

You can post messages from here. But please note that sometimes there's a delay to display the message or it is simply lost. Note also that it contains less than 50% of the messages.

IMPORTANT: do not use this, because GOOGLE points to the old falch.net server, not to the current superwaba.net one. So, posting there will not be viewed by the majority of the community.

Go to TOP- Sent by: guich@20030411


Question

I found a bug in the VM that is makes impossible to continue my project development, I don't know how to fix it and I can't wait for a new VM release!

No pain! Just buy a support package at the SW site. A support incident has maximum priority for us, so we'll stop everything we're doing to find a solution for your problems. After the bug is fixed, a new VM will then be sent to you.

Of course, you can always look at the Codev section of the SuperWabaWiki site and at least try to fix it...

Go to TOP- Sent by: guich@20030221


Whats the difference between Waba and SuperWaba?

Since Waba 1.0b was released, in 14 Feb 2000, it has not been enhanced by Rick Wild, its creator. There was a people that enhanced the 1.0b version a bit, at http://waba.sourceforge.net, but they also have not enhanced it since may 2001. SuperWaba, in contrast, from version 1.0G to 3.3, had about 31 releases! More than one per month (1.0G was released in July 2002). Below is a table with some major differences between SuperWaba and Waba.

Description Waba SuperWaba
Number of classes (not counting java.lang, waba.applet and ext packages) 36 69
Size (classes + VM) 72.3Kb 293Kb
Speed comparision (running Bench program - lower timming = faster) 390860ms 162900ms
Memory avail for programs in PalmOS 32kb Unlimitted (up to the device´s avail space)
Supports Exception No Yes
Supports Color No (in sourceforge, yes) Grayscale and color in all palm devices
double/long (64 bit precision) support No Yes
User Interface Extremely simple Very complete

Go to TOP- Sent by: guich@20030130


Question

I'm curious... how big is the SuperWaba community?

Here are the statistics from January 2002 to September 2004:

Total number of members:

2002 14355
2003 22394
2004 11649

Subscribed Members per month:

2002

Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
35 1089 991 1325 828 575 1219 1879 1762 1839 1693 1339
* Middle August: 3.0 (wince) release

2003
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
1700 1688 1332 1120 1340 1421 2309 2060 2196 2383 2252 2593


2004
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2505 1560 1065 978 1157 1094 1127 1044 1119

Number of versions released in:

2002 2003 2004
14 6 4


We believe that the decrease in members is due to the lack of marketing (less versions released, less marketing). Please help spread SuperWaba in your usual communication channels and also in the specialized sites. Rating SuperWaba in the download sites (PalmGear?, Handango, Freshmeat, Javalobby, etc) also helps a lot.

Total number of countries: 148 (counting only the ones with 3 or more subscribed users)

Top five countries:

2002

USA 3066
Germany 1203
Brazil 1203
France 768
UK 506

2003-2004

USA 8400
Brazil 4353
Germany 2465
France 2108
UK 1574

Number of users that downloaded each version:

version downloads
1.21 474
2.0b4r3 357
2.0b4r4 152
2.0b4r5 161
2.0b4r6 311
2.0b4r7 227
2.0b4r8 972
2.0b4r9 619
2.0final 887
2.1 663
2.2 1439
2.41 4105
3.0 2144
3.11 1050
3.2 950
3.21 4151
3.3 4433
3.4 1261
3.41 2333
3.5a 6354
4.0a 2695
4.01 7346
4.1 4546
4.2 2993
4.21a 1389
4.21b 5585

* The number of downloads also depends on how much time the version was available for download.

Site statistics for visits

2003 2004 2005
255227 233070 361265

Go to TOP - Sent by: guich@20030216 updated in 20041002


GUI Questions

Question

Can't the ListBox? have horizontal scroll?

Starting on version 5.0, we added this possibility. The ListBox? itself does NOT have the horizontal scroll mechanism, but you can easily add it with two new methods. Next, the sample, taken from sdk/src/java/superwaba.ext.xplat.unit.SWUnit.java:

Add the ListBox?, then add a horizontal scrollbar near it:

      add(sbHoriz = new ScrollBar(ScrollBar.HORIZONTAL));
      sbHoriz.setRect(LEFT,AFTER,FILL-2,PREFERRED);
      sbHoriz.setLiveScrolling(true);
After you add the items, set the horizontal scrollbar values, based on the text inside the ListBox? (note that this may not be done at each new ListBox? item because it will make it much more slooooooooow):
      // update the horizontal scroller
      int needed = lb.getNeededHorizontalScrollValue(); // get maximum text size for the listbox
      if (needed <= 0) 
      {
         sbHoriz.setEnabled(false);
         sbHoriz.setValue(sbHoriz.getMaximum());
      }
      else
      {
         sbHoriz.setEnabled(true);
         sbHoriz.setMaximum(needed);
         sbHoriz.setMaximum(sbHoriz.getVisibleItems()+needed); // set again, bc we must include the visible items
         sbHoriz.setValue(0);
      }
Now, you must scroll the list when an event is catched:
   public void onEvent(Event e)
   {
      if (e.type == ControlEvent.PRESSED)
      {
         ...
         if (e.target == sbHoriz)
         {
            lb.setOffset(-sbHoriz.getValue()); // scroll the text
            lb.repaintNow();
         }
That's it! Now you have a horizontal scrolling listbox.

Go to TOP- Sent by: guich@20041225


Question

How can I develop better cross platform user interface apps?

Use the SuperWaba User Interface Guidelines, placing controls in a relative-to-the-last manner. There is a great tutorial for this, the SuperWaba User Interface Tutorial, that is included in the SuperWaba Companion.pdf

Go to TOP- Sent by: guich@20010203


Question

What is the difference between the onStart method and the Constructor. As I noticed, they both execute where I run my appllication!

The constructor is executed first, and onStart immediately after. In the device, there is really no difference at all; But in the desktop, the Graphics object is available only in the onStart method; so, if you use a bitmap splash screen, you must put your initialization code in the onStart method, otherwise, it will not be shown.

Go to TOP


Question

I added various containers to my (Main)Window, but some controls are not working well (are not throwing events or are not responding to clicks). What's wrong?

Be sure that the containers which are siblings, ie, have the same parent, are not OVERLAPPED. Be also sure that the container's bounds are correctly set.

Go to TOP


Question

I'm having problems in using Window.pumpEvents.

Are you calling Window.pumpEvents() anywhere from within a SW Thread? You have to be careful when calling pumpEvents from within a SW Thread. Threads are also executed within pumpEvents() (so that threads will continue running while a blocking modal is open), and if your thread calls pumpEvents() without doing any kind of checking, pumpEvents() will then call your thread, which will call pumpEvents(), which will call your thread, etc, until stack overflow.

Another check you should always do is to surround pumpEvents() in a check for Event.isAvailable(), as pumpEvents() may block (on some systems) until an event is available. In other words, unless you are willing for pumpEvents() to block (not return) until an event is available, do this:

   if (Event.isAvailable())

      Window.pumpEvents();

   Vm.sleep(10);

The Vm.sleep() allows background events such as dialogue processing to occurr.

Also, timer events are handled very similar to threads in SW so that if you have an unchecked Window.pumpEvents() inside of a timer event, you could have the same problem with infinite recursion. This is not to say you can't put Window.pumpEvents() in a timer or thread, you just have to be careful that you do not call Window.pumpEvents() every time the timer or thread executes.

Go to TOPAdded by anodos@20021005 annotated by VikOlliver@20051117


Question

I'm using remove and add to swap two screens but nothing happens.

Are your screens extending waba.ui.Container? Don't extend Window classes to add them to the MainWindow? - typically this will cause eveything in the new window to shift downwards a few lines. Window classes must be used only as Popup Windows.

Also, use the MainWindow?.swap command (see examples/ContainerSwitch)

Go to TOP- Sent by: PeterCarrol?@20010205


Question

How can I avoid flickering in my Window?

Use setDoubleBuffer(true) method in your application's MainWindow? class constructor

Go to TOP- Sent by: guich@20010203


Question

When I change the text of a control (E.g.: a Button) to a bigger text length, the text appears clipped!

SuperWaba controls do not update its size when a setText or equivalent method is called. To resize the control, use this after the setText or setImage:

   myBtn.setText("a text bigger than before!");
   Coord c = myBtn.getPos();
   myBtn.setRect(c.x,c.y,PREFERRED,PREFERRED);

Go to TOP- Sent by: guich@20021205


Question

Whats the difference between TabBar?/Tab and TabPanel??

TabPanel? was introduced in SuperWaba to help the creating of tabs, by creating it given a title array. This example was taked from the TabPanel? documentation:

   public class MyProgram extends MainWindow
   {
      TabPanel tp;

      public void onStart()
      {
         String tabs[] = new String[]{&quot;One&quot;,&quot;Two&quot;};
         tp = new TabPanel(tabs);
         tp.setRect(10, 10, 80, 120);
         tp.setGaps(2,2,2,2);
         tp.getPanel(0).add(0,new Edit(),0,0);
         tp.getPanel(1).add(0,new Label(&quot;Hi!&quot;),0,0);
         add(tabBar);
      }

      public void onEvent(Event event)
      {
         if (event.type == ControlEvent.PRESSED &amp;&amp; event.target == tp)
         {
            int activeIndex = tp.getActiveTab();
            ... handle tab being pressed
         }
      }
   }

Go to TOP- Sent by: guich@20010203


Question

How can I create a popup window in SuperWaba?

Please see the waba.ui.InputDialog, waba.ui.MessageBox and waba.ui.Window classes. There is also a version called MessageBoxChunky in the free program downloads on the SuperWaba web site. BTW, the popup windows looks like this:

  • You still have a MainWindow .
  • You create a new class extending from Window class.
  • From that MainWindow?, you can call popupModal(myWin) to popup that window.
  • To close myWin, call its unpop() method.
  • You can have multiple windows, each one modal to its parent.
  • Note that popupModal method is not blocking; the program continues immediately after the window is shown. To block the program execution until the window is closed, use popupBlockingModal instead.

    Use the following code (example taken from the Window class)

       class TestWindow extends Window
       {
          Button btnHi;
          public TestWindow()
          {
             super(&quot;Test&quot;,TAB_ONLY_BORDER); // with caption and borders
             setRect(CENTER,CENTER,Settings.screenWidth/2,Settings.screenHeight/4);
             add(btnHi=new Button(&quot;Hi!&quot;));
             btnHi.setRect(CENTER,CENTER,PREFERRED,PREFERRED);
          }
          public void onEvent(Event event)
          {
             if (event.type == ControlEvent.PRESSED &amp;&amp; event.target == btnHi)
                unpop(); // a WINDOW_CLOSED event will be posted to this
    
                         // PARENT window by the Window class.
          }
       }
    

    To use it:

       class MyApp extends MainWindow
       {
          TestWindow tw;
          public void onStart()
          {
             popupModal(tw = new TestWindow());
          }
          public void onEvent(Event event)
          {
             if (event.target == tw &amp;&amp; event.type == ControlEvent.WINDOW_CLOSED)
             {
                tw = null; // or any other stuff
             }
          }
       }
    

    For more information, see the javadocs for waba.ui.Window.

    Go to TOP- Sent by: guich@20010203


    Question

    How can I access the menu without a title to click on?

    There are two ways to access the menu in Windows CE:

    1. Clicking in the window's title.
    2. The menu in WinCE? is handled also by the IKeys.ACTION key. Note that if you call InterceptSystemKeys? requesting an intercept on the ACTION key, it will disable the menu handling by the system.The ACTION in iPaq occurs when you press the four-way button.

    Go to TOP- Sent by: guich@20030612


    Question

    How can i increase the scrollbar width in a ListBox?/ComboBox?

    Use this:

    Button.commonGap = 2;
    // construct and add your Combo/Listbox to the container
    Button.commonGap = 0; // reset it.
    

    Starting in SuperWaba 4.21, there's also a ComboBox? and ScrollBar? field named extraArrowSize, which will increase the arrow bitmap.

    Go to TOP- Sent by: guich@20040122


    Question

    Why isn't there something like a Scroll Container in SuperWaba?

    SuperWaba uses a simple clipping algorithm (see Container.paintChildren). Because of this, it can't handle complex clippings that the ScrollContainer? would make necessary. This would make the control's paintings to overflow the ScrollContainer?'s area. There are some controls available out there (e.g.: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/jdict/jdict/jdict_P/src/jdictp/guidevice/ScrollBox.java) but they may fail in some cases.

    Another scrolling container you might like to look at is ControlListBox

    A better scrollable container is in development at the moment. See the HTML classes.

    Go to TOP- Sent by: guich@20030210


    Question

    My application works great in normal Palm OS devices. But when I run it in devices with a resolution bigger than 160x160, my Window moves from the position I specified.

    This happens because you had not prepared your code for superior resolutions. In SuperWaba, the controls are placed in a relative position. But that requires that you specify the Windows size. Since in a bigger resolution the size must change, you need to test it and find the best size for your window in this bigger resolution. To make the old programs work, SuperWaba tests if the flag highResPrepared is set. If not, SuperWaba sets the size of the Window to be twice the specified size, and repositions the Window in the center of the screen. So, you must do something like the code below:

       public MyWindow()
       {
          super(&quot;My Win&quot;,RECT_BORDER);
          highResPrepared = true;
    
          // test if we're running in Sony devices, with big fonts
          boolean higherResolution = fmH &gt; 11;
          float factor = (float)fmH / 11f;
          int w = (int)(100 * factor);
          int h = (int)(120 * factor);
          setRect(CENTER,CENTER,w,h);
          ...
    
    Important note: if you want to emulate a Sony 320x320 device, use the following parameters:
      rundemo /w 320 /h 320 /scale 1 /useSonyFonts /bpp 8
    
    To emulate a Windows CE or Pocket PC device with 240, 480 or 640 horizontal resolution, use:
      rundemo /w 240_or_480_or_640 /h 320_or_anything /scale 1 /bpp 8
    

    If you are using more recent versions of SuperWaba that use a build.xml file, copy one of the sample build.xml files such as the one in SWCalc and edit it to replace SWCalc with your application's name. Then you can edit the "run-init" section to look like this, and change the values to suit your situation:

    <target name="run-init" depends="build-init">
      <property name="applet.scale"  value="1"/>
      <property name="applet.bpp"    value="8"/>
      <property name="applet.width"  value="320"/>
      <property name="applet.height" value="320"/>
      <property name="applet.uiStyle" value="WinCE"/>
      <property name="applet.useSonyFonts" value=""/>
    </target>
    

    Go to TOP- Sent by: guich@20021005


    Question

    Why does using popupBlockingModal() to show a MessageBox? in onStart() hang?

    The window that you are trying to pop the MessageBox? up on top of is not ready yet.

    To get round this, use a Container to hold the code that wishes to do a popupBlockingModal, and do Window.getTopMost().popupBlockingWindow() from within it. This will work in the onStart() method of the Container because you create the main Window before the Container is initialised. This is an example of the use of Swap to load a container from a main Window class:

       public void onStart() {
          /* Now we get our client rect, excluding the border and the title */
          Rect r = getClientRect();
          /* Prepare the splash screen. */
          splash=new SplashScreen();   // A Container
          splash.setRect(r);
          /* Swap in the SplashScreen module. */
          swap(splash);
    
       }
    
    Go to TOP- Sent by: vik@20042901


    Question

    In some PocketPC devices (eg.: Ipaq 2210/1910) the Virtual Keyboard remains in the top of screen and only a soft-reset make it return to his normal position , how to change this annoying behavior ?

    To get round this, use a piece of code in the onExit of your MainWindow?. something thus:

       public void onExit()  {
       setStatePosition(0,Window.VK_BOTTOM);
       }
    
    Go to TOP- Sent by: sivuca@20042110

    Catalogs & Databases

    Question

    How can I use PDBDriver with SuperWaba versions 5.7 and up?

    All you have to do is use the new superwaba.jar file with the old PDBDriver classes at desktop. The device files remains unchanged.

    Here's the script: Grab the superwaba.jar you have in your old SuperWaba version. Rename it to pdbdriver.jar. Now open it (winzip opens it) and delete all classes, except the superwaba.ext.xplat.sql.pdb ones. Now add this pdbdriver.jar to the classpath, and use the 5.7 (and up) virtual machine along with the XPlatSqlPdb?.* files from your old SuperWaba version.

    Question

    How can I write a database in Palm?

    Don't modify the creator id. You have to use the same that warp generates for your programs. This is because the creator id is used to attach the databases to your program. This way, when you delete your prc from the palm, the database associated with it will also be deleted. Since you discovered who is your creator id (by using waba.sys.Settings.appCreatorId ), put it statically in your code. To have different databases in your application, you can create different types. So, lets say your creator id was put an a variable

       String creator = &quot;xxxx&quot;;
       String type = &quot;MyDa&quot;; // stands for My Data
    

    When you create the new catalog, use:

       cat = new Catalog(type+&quot;.&quot;+creator+&quot;.&quot;+type,Catalog.CREATE);
    

    Only by using this approach, you will be able to use your database in a java conduit.

    Note that Catalog.CREATE does not overwrite the pdb if it exists.

    Go to TOP- Sent by: guich@20010203


    Question

    Are there any other examples of working with catalogs or databases?

    Yes, see superwaba/examples/TestCatalog.java.

    Don't forget to read the Catalog chapter that is included in the SuperWaba Companion.pdf.

    Go to TOP- Sent by: guich@20010217


    Question

    How can I read and write using waba.io.DataStream and waba.io.ResizeStream?

    Use the following piece of code to read from your database:

       // open the catalog
       String creator = waba.sys.Settings.appCreatorId;
       String type = &quot;MyDa&quot;; // stands for My Data
       Catalog cat = new Catalog(type+&quot;.&quot;+creator+&quot;.&quot;+type,Catalog.CREATE);
       DataStream ds = new DataStream(cat);
       // read from it
       if (cat.setRecordPos(0)) // read record 0 - if it exists
       {
          int anInt = ds.readInt();
          String aString = ds.readString();
       }
       cat.close();
    

    Use the following piece of code to write over the previous stored record

       // open the catalog
       String creator = waba.sys.Settings.appCreatorId;
       String type = &quot;MyDa&quot;; // stands for My Data
       Catalog cat = new Catalog(type+&quot;.&quot;+creator+&quot;.&quot;+type,Catalog.CREATE);
       ResizeStream rs = new ResizeStream(cat,256);
       DataStream ds = new DataStream(rs);
       // part 2
       int anInt = 334455;
       String aString = &quot;HI world!&quot;;
       if (cat.setRecordPos(0)) // delete it first
          cat.deleteRecord();
       if (rs.startRecord(0)) // reinsert it in this index
       {
          ds.writeInt(anInt);
          ds.writeString(aString);
          rs.endRecord();
       }
       cat.close();
    
    Note that when just reading from a catalog, there's no need to attach it to a ResizeStream?.

    Go to TOP - Sent by: guich@20010203


    Question

    How can I import some text into a pdb file to use in Palm?

    You can read the text from your desktop computer using java.io.* classes and use the class Catalog from SuperWaba to create the pdb file. Then, just synchronize it to your Palm. Please see utils/xplat/ImportTxt for an example.

    Go to TOP- Sent by: guich@20010203


    Question

    When I use Catalog.deleteRecord , my waba app freezes...

    Whenever you call deleteRecord() , make sure that the current record position has been set. EG:

       cat.setRecordPos(0);
       cat.deleteRecord();
    

    Go to TOP- Sent by: edCrandell@20001013


    Question

    I'm getting a "bus error" when trying to write to Catalogs

    I am writing to a Catalog for my app during the onExit() method. I am doing this in a straightforward way but periodically I get a "Bus Error" from the Palm Emulator stating Waba 1.02 is giving it. On Palm Pilot itself, the error is "Fatal Exception".

    Adding a Vm.sleep(10) resolves the problem. See the following code:

       public void onExit()
       {
          Vm.sleep(10);
          strEditText = edit.getText();
          writeRecord(prepareRecord(),recIdx);
       }
    

    Go to TOP- Sent by: KevinG?.Paterson@20001031


    _Question_un

    How can I use the nonGUIApp to create a program to just read a Catalog in the desktop, without a waba Graphic User Interface?

    Look at this code sample:

       public static void main(String args[])
       {
          waba.applet.JavaBridge.setNonGUIApp();
          waba.io.Catalog cat = new waba.io.Catalog(&quot;\\superwaba\\classes\\Pupil.Font.Font&quot;,
                                                    waba.io.Catalog.READ_ONLY);
          if (cat.isOpen())
             debug(&quot;ok, is open&quot;);
          else
    
             debug(&quot;not opened!&quot;);
       }
    

    Note that when using nonGUIApp, you cannot use the waba.ui and waba.fx package, or your program will fail. Also note that in this special mode you can specify the full path to the file, appending the crtr.type but not appending the .pdb. The program will take care of it.

    Go to TOP


    Question

    Is there a binary search to find strings in an ordered catalog?

    Here it is:

       // here is an example of use:
       // if (findByBinarySearch(barcode) == -1)
       // {
       //    /*ERROR*/
       // }
       // else
       // {
       //    /*GET RECORD*/
       // }
    
       private int findByBinarySearch(String barcode)
       {
          int numRecords = cat.getRecordCount();
          int lowpos = 0;
          int highpos = numRecords - 1;
          int currentpos = 0;
          String key;
    
          while(true)
          {
             currentpos = (lowpos + highpos) / 2;
             cat.setRecordPos(currentpos);
             key = ds.readString();
    
             if (key.equals(barcode))
                return currentpos;
             if (highpos == lowpos + 1)
                lowpos = highpos;
             else
             if (lowpos == highpos) // not found
                return -1;
             else
             if (barcode.compareTo(key) > 0)
                highpos = currentpos;
             else
                lowpos = currentpos;
          }
       }
    

    Go to TOP- Sent by: Tony Goodwin


    Question

    A database created with SuperWaba 2.x is not read in SuperWaba 3.x.

    Because of a bug in SuperWaba 2.x desktop versions, all the records in the created PDB was marked busy. In the Windows CE implementation of the Catalog the record is tested if is busy. Since it is busy, the Catalog.setRecordPos method i just return and you have no access to the record.

    You have two choices:

    1. Generate again at desktop all databases, with SuperWaba version 3 (or newer). or 2. Do a program that opens your database but don't close it. Then, you do a reset in your device. This will make the dmHdrAttrOpen to remain true. The next time you open the catalog, my routines will reset all busy attributes.

    Go to TOP- Sent by: guich@20021005


    Build Issues

    Question

    I'm getting errors messages like "Can't access app classes!" or "Can't initialize application"

    This error is thrown by the VM by one of the following reasons:

    • The application does not extend waba.ui.MainWindow
    • The creator id specified for exegen is different of the one specified for warp. Be sure to use the default creator id or assign a new one with the /c parameter to both warp and exegen.
    • The application does not have a public constructor
    • Your application is stored in a package but you forgot to add the full package+class name to exegen. This is an example on the versapalm.finance.VPFinance application is warped and exegen'd:
    \jdk1.2.2\bin\java -classpath \jdk1.2.2\lib\rt.jar;\superwaba\bin;\superwaba\classes;.
        Warp c VPFinance versapalm/finance/VPFinance.class
    \jdk1.2.2\bin\java -classpath \jdk1.2.2\lib\rt.jar;\superwaba\bin;\superwaba\classes;.
        Exegen "Finance" versapalm/finance/VPFinance VPFinance
    
    Note that the . in the classpath means that I'm in the parent directory of versapalm/finance/...
    • Are you using the same creator id for two different applications?
    • You have not installed both prc and pdb files in the device.
    • When using Warp, avoid specifying something like .class or /dir/subdir/.class. Just specify the main window Class; Warp will add the needed classes for you.
    • When using Warp you cannot specify the directory of the class (E.g.: ..\source\com\apelon\emr\test\waba\HelloWaba.class); you must make sure that the class is accessible via the classpath. In this exampla, add ..\source to the classpath, and call Warp c com/apelon/emr/test/waba/Hellowaba.class (assuming that the package is com.apelon.emr.test.waba).

    Go to TOP - Sent by: guich@20021013


    Question

    Why does Ant complain about a nested "tokenfilter" ?

    If you get the following error during a build of Superwaba:

    BUILD FAILED file:/SuperWabaSDK/build.xml:144: The data type doesn't support the nested "tokenfilter" element.

    You have to upgrade to Ant 1.6 or later.
    This versions are required to extract the version number from the Settings.java source file.
    It will be the unique place where Guich performs a version change.

    If you don't want to upgrade your Ant. You may also change the "build.xml" file.
    Simply locate the "get-version" task in the build.xml and comment out the whole block as explained and uncomment the line defining the property "versionStr".

    Go to TOP- Sent by: fdie@20040305


    Question

    Where can I download the SDKs needed to recompile the VM?

    1. Open nmpalm_defines.h
    2. Comment the #include "PalmChars.h"

    1. Open nmpalm_bridge.c
    2. Comment the following lines, then recompile:
    case vchrNavChange: // 5-way
       ...
       break;
    

    Go to TOP- Sent by: Steve Kelem@20030410


    Question

    I want to use the superwaba.ext package but nothing compiles, or it bombs at the device

    SuperWaba has great extensions, located under superwaba/ext/... . They are not part of the VM because most users don't need them. If you do need them, then you need to:

    1. Add the SuperWaba root to the classpath, so javac can find the superwaba.ext classes. For example, if you installed SuperWaba on c:\superwaba\... , then you must add c:\ to the classpath.
    2. Now you need to add the proper library (a pdb located under /superwaba/bin/<platform>/libraries) which contains the compiled classes that can be used at the device. To find which pdb you need to install, please check the javadocs of the package you want to use. E.g.: to use superwaba.ext.xplat.ui.MultiEdit , check the javadocs for superwaba.ext.xplat.ui .

    Go to TOP- Sent by: guich@20030221


    Question

    I'm having strange inheritance problems with SuperWaba

    You're probably using JDK 1.4.x. This version changed the way that methods are called internally, thus resulting in some weird inheritance problems. I preferred not adapt the VM to handle this because it would make method calls much slower. Fortunately, the workaround is very simple: use "-target 1.1" in your javac command line and your problems are gone.

    Go to TOP- Sent by: guich@20030216


    Question

    I'm getting a fatal error from Warp when i'm converting Integers (or other types) using java.lang.Integer.toString or Integer.parseInt.

    In SuperWaba, you can't use java.lang.Integer , java.lang.Double , etc. But everything you need is provided int the waba.sys.Convert class.

    Go to TOP- Sent by: guich@20021205


    Question

    Which JDKs are compatible with SuperWaba?

    JDK 1.1.x, 1.2.2, 1.3.x, 1.4.x and 1.5.x. The best version, which produces the optimal class files, is version 1.2.2. Note also that SW have some problems with JDK 1.4.1. You must specify "-target 1.1" in the command line of javac.

    Go to TOP- Sent by: guich@20010203


    Question

    How can I compile a SuperWaba app?

    Starting on version 3.5, you'll need to use ANT. Please see the SuperWaba.pdf file inside the SDK for more details.

    Go to TOP- Sent by: guich@20030619


    Question

    How can I compile my SuperWaba classes, having JDK 1.5.0 installed on my W2K desktop?

    Note: besides of what is described below, which may be useful for others, you can use 1.5 with superwaba by using: javac -target 1.1 -source 1.3 ...

    SuperWaba needs Java 1.1 compatible bytecode. You can tell your javac compiler to generate code different from the javac version of the compiler, using the -target command line option. Unfortunately JDK 1.5.0, facing increasing backwards compatibility problems, does not support target version 1.1 anymore. So you need multiple JDKs installed on your machine. Unfortunately you cannot install an older version of W32 JDK after you have installed JDK 1.5.0. It will crash your 1.5.0 runtime environment and JDK 1.5.0 cannot be uninstalled anymore. If this happened to you, you have to install the full JDK 1.5.0 including the runtime environment over your messed up system, which fixes it. Then you can uninstall JDK 1.5.0 properly. And only now you are ready to uninstall and reinstall the older JDK 1.2.2 (or 1.3.1). You only need the SDK, to get the 1.2 (or 1.3) compiler. You don't need the old runtime, if you will use Java 1.5.0 as your default. It is ok now to install JDK 1.5.0 (including the runtime environment), after you have JDK 1.2.2 (or 1.3.1) installed properly.

    Now you will find, that it is difficult to run the JDK 1.2 (or 1.3) compiler on command lines or on your favorite IDE like Eclipse. And the many hints and options offered to support multiple runtime environements not only don't seem to work at all, but also have nothing to do with your problem to use an old compiler, which is part of the JDK, not the JRE. To compile SuperWaba classes using a specific compiler, you can use the Javac ant task parameters fork, executable and compiler as on the following example, tested with ant 1.6.2:

         <javac srcdir="C:\DATA\Development\eclipse\workspace\PocketELZE\src" 
              destdir="build" 
              target="1.1"
              fork="yes"
              executable="C:\java\jdk131\bin\javac.exe"
              compiler="javac1.1">
              <include name="**/*.java"/>
              <classpath refid="classpath"/>
         </javac>
    

    Now you can change your build.xml file to use these settings. You may want to use a copy of the build.xml, that comes with SuperWaba for the SWCalc sample application as a perfect starting point.

    Go to TOP- Sent by: RenatoMercurio?


    Question

    Does anyone know what to do when exegen gives the error: Launch string too long?

    At first you have to know that the problem is in the exegen program not in your class name. The exegen has a String lenght limit of 200 characters in its arguments. You have to create a new alias class that has a simple name like:

       package mgenix;
    
       import waba.ui.*;
       // the correct example should be a package with more than 190 characters
    
       import com.mediageniz.vision.visioningApplication;
    
       public class VisionApp extends visioningApplication
       {
          public void onStart()
          {
    
             super();
          }
       }
    

    Go to TOP- Sent by: MarkoChu?@20001128


    Question

    Can I use the WExtra's package in SuperWaba?

    No need. Starting in SuperWaba 3.21, WExtras was completely merged into the superwaba.ext package. Also, all duplicated classes were removed.

    Go to TOP- Sent by: guich@20010203


    Question

    Is there a way to set the Version Number of a SuperWaba app?

    Yes. Just use the /vfor Exegen.

    Go to TOP- Sent by: guich@20010203


    Question

    I'm compiling the program from command line with<command-line>Warp c Test *.class; but I get Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1. What's wrong?

    Don't use *.class. Please specify instead the name of your class that extends waba.ui.MainWindow, and all classes it uses will be automatically added. For example:

    Warp c Test Test.class

    Go to TOP


    Question

    When i run Ant, why does java complain about JIT errors ?

    The JIT support of some old JDK versions have bugs and or not compatible with some java applications such as Ant. The solution is to disable the JIT like explained in the JDK 1.2.2 documentation

    set JAVA_COMPILER=NONE
    

    anT try again...

    Go to TOP- Sent by: frank@20040502

    Question

    When I try to install my PocketPC/WinCE application, why do I get "Application Manager cannot install this application on your mobile device due to an invalid setup file." error message?

    It turns out that Application Manager cannot work with files which have a program name longer than 8 characters. That is, the word before the ".Platform_CPU.CAB" must be 8 characters or shorter. For example: changing "CoursePro.PocketPC_ARM.CAB" to "cp.PocketPC_ARM.CAB" (along with the other 9 CAB files) will prevent Application Manager from crashing.

    Go to TOP- Sent by: DanielMeehl@20040514

    This is now fixed in SuperWaba 4.21a. The cab files are now named so there are no issues. Developers should upgrade their SDK for these changes.

    Go to TOP- Sent by: IanGeiser@20040603


    Question

    I would like to build a Global Extension Library within Eclipse, but the Eclipse SuperWaba plugin does not offer this option. How can I do it?

    You should modify the file build_superwaba.xml of the project and add a line with arg value "/lg" to the parameters of Warp, as shown below:

        <!-- Execute WARP -->
        <target name="warp" depends="jar">
            <java dir="build" classname="Warp" fork="true" classpathref="utils">
                <arg value="c"/>
                <arg value="/lg"/>
                <arg value="${ant.project.name}"/>
                <arg value="${ant.project.name}.jar"/>
            </java>
        </target>
    

    Then you go to the project Properties, Builders tab, and Import the build_superwaba.xml you have just modified. Now tell eclipse to Build Project, but not to Build SuperWaba Application, otherwise the build_superwaba.xml will be deleted and created for new.

    A longer explanation is given in this tutorial http://robotica.uv.es/~jjordan/tutorials/eclipse/library.html
    Go to TOP- Sent by: juangui@20050204


    Conduits and SuperWaba

    Question

    How can I retrieve the Settings.appSettings string in my Palm CDK-based conduit?

    You can retrieve the appSettings value via a conduit by calling the

    SyncManager.SyncReadAppPreference
    function (for JSync conduits, the function is
    SyncManager.readAppPreferences
    ). There are a couple of things to note:
    • You must use a preference id of 1 (the number one).
    • Currently (8/06/2004) the SW Java Doc is incorrect when it states that the appSettings value is stored in the unsaved preferences database. According to the source, this was changed at some point to the saved preferences database. So the "backedUp" argument must be set to true.
    • If the appSettings value has never been set, an exception is thrown when calling this function (file not found error).
    Go to TOP- Sent by: JeffFaath?@20040806


    Program deployment

    Question

    I want to deploy my application to end-users. Any hints?

    Thanks Michal Hobot, SW now has a good installer. You can, using the /z option in Exegen, create install files for your applications (Windows CE only).

    But these install files won't include the VM. There's no problem with that: You can make the user download your install files and then access the site:

    http://www.superwaba.org/install

    ...to download the VM from there.

    These installation files include the required font files and the libraries XPlatIOUIUtil?.pdb, XPlatGame?.pdb and XPlatUtilProps?.pdb for all supported platforms. More instructions at the site.

    Go to TOP- Sent by: guich@20030214

    For distribution of your SuperWaba application on PalmOS and WinCE?, SourceXtreme?, Inc has released their GPL installer for PDA devices. This can be downloaded at: http://www.sourcextreme.com/projects/matchbox

    With this installer tool developers can distribute their SuperWaba applications in a single Windows executable binary that will install their application on their Palm or