Journey into SuperWaba

Ever wonder what it takes to write programs for your PDA? I did, and so now I am beginning a journey to try my hand at writing something for the PalmOS. SuperWaba, a variation of Java for the PDA, is my language of choice. And I'm a novice, which makes it all the more unpredictable. Hope you'll come along for the ride! Note: You can read multiple posts on one page if you click on an archive link.

Thursday, July 29, 2004

ED: Motion may slow down

Oh no! I lost my blog again because when I published, I got a server error and then refresh and back didn't recover my typing. Memo to self: Save the blog contents before publishing!

Well in short summary form, here's what I said...

I'm tight on time, but mostly you are seeing the updates slow down because it's tough going. I'm having trouble getting my bearings. So far it's been pretty clear what to do or at least what to figure out. Now I'm floundering a bit. I either need to better understand the tutorial, or take a detour to write some Java as a refresher, or maybe find some relevant and simple SW sample programs to study.

If anyone has some nice simple sample programs with source, please let me know about hat in the comments for this post! I haven't really looked all that hard yet, though, so hopefully there's some good stuff on the superwaba site.

So be patient with me as I work on finding my way out of this "lost" state I'm in! Rest assured, I haven't given up, I'm just slow!

ED: Next Steps are Tough!

Well, you haven't seen as many updates from me recently. Wondering why?
A couple of really simple reasons:
1) I'm very busy.
2) The next step seems to be very hard for me to get a handle on.

Mostly #2. So when I figure some of this out, you get the benefits!

I could handle the stuff I've done so far relatively quickly because I kind of knew where I was headed, or there was great documentation. But the next steps seem to be quite a challenge because I need to somehow get my bearings. How do I go from the sample SW shell program from MobileCreator to a "real" app with guts? How does the whole GUI interface and event stuff work?

To me, these things don't seem to be real trivial to pick up. I have a lack of Java knowledge. It is not easy reading to get that info out of the tutorial (but I have to admit I haven't really sat down with some time to figure it out from the tutorials). If a little more effort with the SuperWaba manual doesn't get me anywhere, I'll jump into some of the sample programs and try to find something simple enough to understand. All else fails, I'll take a sabbatical from SW and write some simple things in Java just to get my bearings before I dive back into SW.

So be assured I haven't quit. It just may be slow going for a little while.

Sunday, July 25, 2004

Will It Be Pretty? NO!

The next step has been somewhat vexing for me, because there's a big chasm between where I am and where I want to go.

You see, I'm not sure what program is my end goal. I have lots of options, but need to know more before I pick.

I could start compiling and fiddling with more of the demo programs. Or I could go through the tutorials. Or to shore up a bit more with Java, I could go back to my Beginning Java book first. What to do?

Well, while I sort that out in my mind (my schedule's been busy so haven't had any time for my hard-core learning time), I thought I'd post another thought about the look and feel.

As I pondered my end result I realized that I also have to make some decisions about what the end product is going to look like. I don't like the appearance of many of the superwaba programs I've seen. They're, well, just kind of ugly. But others seem nice, so I know it must be a matter of how you write the code.

I don't really want to write an ugly app. But when the rubber hits the road, I have to be practical. I'm not a gui designer. I've seen posts on the newsgroup that tend to give me the impression that fancy gui stuff (like underlining certain elements) is pretty complicated. And I find it's generally true for all software tools that you find the going much easier if you use it the way it was designed to be used and for the mainstream features only. If you start to push the envelope it can be exciting if you know what you are doing, but pretty darned annoying if you are a novice without much time to problem solve.

So there it is.... the answer to "Will it be pretty" is NO! I've reconciled myself to the fact that I have limited time and limited knowledge, so for now I'm going to make any apps I write pretty barebone, both in style and probably in functionality. If I decide to publish a program to the world later, I'll worry about pretty at that point.

Sort of as a corollary, I seem to get the impression that one of the great challenges of programming for Palm is making it work on the wide range of devices available. SuperWaba should help a bit with that, but I'm sure it's still an issue. For now I will be content to just program for my T|E simulator and/or my SJ33.

Ahhhhhhhhhhhhhhh........... I feel much better. It was hard for me to settle for bare bones like this, but now that I've faced the facts, I think it's lifted a great burden off my back, and I'm excited about moving forward again.

Saturday, July 17, 2004

ED: Tutorial Purchase Adventure

I did it. I placed an order for SuperWaba tutorials. They are supposed to be available immediately after a credit card purchase. Why did I ever think it would be that easy????

I only got one email from the order processing company that said the order was received. I was promised another soon that would indicate the order was processed (or not if there was a problem). Another email never arrived. And when I sent a follow-up email as suggested if anything went wrong, I expected at least an automated response to assure me I would be taken care of. No response.

All kinds of thoughts race through my mind.... Is it a scam? Did I make any typos? What chance do I have of getting my money back? How much hassle is this going to be?

One of the bad omens right from the start was a bold and flashing text (yes flashing! I kid you not!) at the beginning of the order process warning me that I might lose my money if I type in the wrong email address. If I hadn't wanted so much to get the tutorials, I would have probabaly backed out of the whole thing right there! Maybe I should have?

UPDATE: That was "yesterday". Today I went digging. I sent another follow-up email. Nothing happened. So I went to the processing main url at regsoft.com to see if I could find out anything, and get an idea of how worried I should be. Fortunately, it looked like a legitimate web site. I dug some more and found they have some customer support contact options (which I've listed below in case anyone else has problems -- the information was NOT given anywhere in the ordering or follow-up process, so unless you dug into regsoft.com you would not find it).

After about 15mins of hold while listening to what sounded like a low-quality 1 min song loop, I got a human voice. What a grand relief! He got hold of his supervisor, who determined that my email address had been flagged as suspicious. I guess when an order is suspicious, it gets ignored? At any rate, they released it manually, it seems to have gone through because I have a confirmation email now.

A check on the superwaba.org site shows that I have rights to download. I transferred them onto my PC and I'm good to go. What's in them? The UI tutorial has a 61pp .pdf document plus a bunch of sample code.

Time to start digging in a bit more. See you next time! 

==============================
Please note that this information is off the regsoft page, so I can only say that it's apparently valid as of today... July 17, 2004.

How can I reach RegSoft.com?You can reach RegSoft.com in a number of convenient ways:

E-mail: By far the fastest and best way to contact us. We read our e-mail on a very active basis. Kindly send comments to our representative at sales@RegSoft.com.
Phone: You may reach us by phone at in the United States at 1-877-RegSoft.com, 1-877-734-7638 or at 1-770-319-2718.
FAX: 1-770-497-9234
Mail: You may also reach us by sending a letter to: RegSoft.com Inc.9625 West 76th Street, Suite 150 Eden PrairieMN 55344






HelloWorld2

Today is a brief and simple post to describe a "real" Hello World application. It prints a message inside the main window. That's it.
 
The code was taken from the wabasoft.com article about how to write a simple program.
 
Continuing with my favorite software at the moment, I used MobileCreator to create a new project. First time I got repeated errors because I chose to not let the project wizard create a main window class automatically for me. As a result I was unable to add a class later. The easy workaround until I figure out what's really going on, was to create the project again, and let it create a main window class for me.
 
I called it HelloWorld2, and used the following code...
 
import waba.ui.*;
import waba.fx.*;
 
public class HelloWorld2 extends MainWindow {
       
        public void onPaint(Graphics g) {
           g.setColor(0,0,0);
           g.drawText("Hello SuperWaba World!",0,0);
        }       
 
}
 
Notice that I've made another discovery... how to format code in this blog! Turns out that I have to paste it into MS Word first. Then cut and paste into the blog. Don't ask me what changes, but it seems to work!
 
I ran it with the "green flag" button, and it ran in the applet first time no problem! I changed the dropdown box to use the Palm TE simulator. Works like a charm in the simulator also!!
 
This whole experiment and blog entry probably took me about 10mins total. Life is good!
 
I haven't decided what comes next, but have ordered the tutorials for SuperWaba. Will make a decision based on what those look like.
 

Friday, July 16, 2004

ED: No Longer Feeling Outcast!!!

Happy news to report today! That Palm community spirit is alive and well in my eyes in SuperWaba land. David B has responded to my post and encouraged me with his kind words. Hallelujah!
 
You may say, why do you care so much about a stupid post? Was the information that important to you. Do you really care if anyone responds?
 
Well, yes, it is important to me. The greatest motivation I have with Palm devices is not the PalmOS itself (though I am a big fan). It is the heart and soul of the Palm community of developers. I have witnessed the warm and generous nature of a few of the developers, plus some of the others in the Palm community. It may not be important to some, but I am saddened by the loss of kindness in this world at times. Call me wishful, but I like to think people can
be kind to one another, and not be entirely self-centered. And that means being kind to not just those that can do something for you, or that you highly respect, but being nice even to people like me that probably sound like goofballs because I don't really know what I'm talking about..... yet!
 
I had an interesting conversation the other day with a friend about a small midwestern town in the US. She was visiting relatives there with her husband, and she was amazed by their friendliness and kindness. They were so nice that it was intimidating at first, and a bit unnerving. But once they realized the people were just being nice it was greatly refreshing and reminded her of how, in comparison, most people are so much less kind and friendly.

I see a little bit of that goodness in the Palm community and it's a big part of why I am excited to be a part of it. It's really not very likely, but maybe one day I can even contribute some useful code. For now, I maybe can encourage a few people in other ways like the Palm and PDA forums. Over and over I see people motivated to help one another. That shift away from
selfishness is refreshing. People are born with the capacity for great amounts of goodness, and it's wonderful to see a bit of that come out.
 
Okay, I'm off my soapbox again for today. Next up is some more SuperWaba HelloWorld.

Update (7/27/04): Interesting thing... I looked back at the newsgroup for my post to see if anyone else had seen it and responded. Not only were there no more responses, but it was missing completely! I guess someone watches over the list and "cleans up." Hmmm...


Thursday, July 15, 2004

First SuperWaba Program (Shell)

Today, I am thrilled to be writing about actually programming something trivial and running it on my SJ33 Palm Clie. We'll also run in on a TE emulator. But not on a Sony emulator because of Sony's lack of ongoing support for the Clie line.
What we will run is really just a program shell that is created by MobileCreator when you start a project, so it's not like I'm really writing any lines of code yet. Still, I'm very happy to get one step closer!
First things first. I've installed MobileCreator with the Palm emulator (not really needed anymore because I'm going to simulate the TE instead), the Palm simulator set up for a TE, and the Sun SDK.
So far things are pretty straightforward, but let me describe a couple of the settings. I intended to put some screenshots here, but turns out that's only easy if I'm updating the blog with FTP, or if the pictures are already online somewhere. Neither is the case for me at this point, so intead of screenshots, here's a description of some of the key settings I've chosen...
 
(Under Project... Settings... )
 
At Exegen Tab...  I've checked "Start Exegen"
At Warp Tab...  I've checked "Start Warp" and "Recurse Subdirectories"
At JDK Tab... Use java.exe
At Paths....
    SuperWaba path = C:\Java\SuperWabaSDK    JDK path = C:\j2sdk1.4.2_04    Emulator = C:\Java\POSE\Emulator.exe
    Simulator = C:\Program Files\TESimulator\PalmSim.exe
    Applet = Well, this doesn't really matter because I can't get it to work right. Instead I'm using the simulator.
 
We're almost ready after the simulator is setup. As I indicated, the TE simulator is a best case alternative for either an AppletViewer or a Palm Emulator for SJ33. Neither of those seem to work, in the sense that I can't get the applet viewer to use my fonts and the SuperWaba newsgroup community considered my case unworthwhile or uninteresting. And the SJ33 roms are not available because Sony has cut off support to the Clie line. Did I mention yet how disappointed I am in Sony?
 
Okay. As far as setting up the simulator, you get it from the Palmsource developers web site just like the emulator. I guessed at a few parameters to set. After you launch the simulator, you have to do the startup preferences routing and then you can right click and set 32 meg RAM and increase the dynamic heap memory to 2048 KB. You may have to do preferences one more time. I then installed the SuperWaba palm files for OS5, and the LSW/MSW/HSW font files for SuperWaba.  At that point I did Storage... Save to save my profile.
 
Now it's supposed to keep all the session info in the palmsim.ini file that's in the same directory as PalmSim.exe. It will then launch next time in the same condition it did the first time. Well that wasn't happening for me and every time I launched the simulator application I had to redo preferences and load the .ssf settings file I had saved the previous time. I called mine storage_snapshot.ssf.
 
Well, even worse, MobileCreator is supposed to be able to launch the simulator as part of the compile and run process so that with one click of the mouse in MobileCreator you can compile and run on the simulator. Pretty nifty! If only I could get it to work. I won't go into all the details of the round about way that I came up with an answer (partly because I don't remember the details, and partly I'm embarrassed to tell you all the rabbit trails I went down to try to do a "workaround" before I found out how simple it is!)
 
The simple answer is that you just need to make sure that you have the following lines in your palmsim.ini file...  (but use your own settings filename, of course)
LastStorageSnapshot=C:\Program Files\TESimulator\storage_snapshot.ssf
StorageSnapshotFile=C:\Program Files\TESimulator\storage_snapshot.ssf
 
Now everything works like a charm. Open up MobileCreator and create a new project. The program looks like this (sorry again about the formatting -- I need to find a solution for that in this blog pretty soon!):
 
import waba.ui.*;
import waba.fx.*;
public class HelloWorld extends MainWindow {       
Font font = new Font("Tiny", Font.BOLD, 10);       
String menu[][] = {              
{"Options","Cut","Copy","Paste"},              
{"About HelloWorld","Info"}        };                    
public HelloWorld() {               
highResPrepared = true;               
setDoubleBuffer(true);               
setBorderStyle(TAB_ONLY_BORDER);               
setTitle("HelloWorld");               
setMenuBar(new MenuBar(menu));       
}               
public void onStart() {       
}        
public void onEvent(Event event) {               
highResPrepared = true;       
}        
public void onPaint(Graphics g) {       
}              
}
 
Some of the hires and font stuff may differ from what you get if you are giving it a try. I was doing a lot of playing around with the font related stuff to make it look right on my Sony. Don't know yet what is important and what is extraneous. And I also added some text that looks like HelloWorld just to make it feel more like a HelloWorld-like program.
 
Set the drop down box to Palm Simulator and click the green flag toolbar button for save, compile and run. There it is!!!! You also get the .prc and .pdb files to install on your Palm if you checked the Start exegen and Start Warp boxes in project settings. Install them just like any other programs on your Palm, and you can see the results work there also!
 
That's actually pretty neat! We haven't really coded anything, but as you can tell, we've made a lot of progress. Still some big unanswered questions...
*) How does all this hi-res stuff and font-selection stuff work?
And the main point of this whole exercise, which is
*) How do I code to this Java-like API to write a real program?
 
Okay, so what's next? We have a program shell, but it's really not a HelloWorld program. There is a WabaSoft document that tells all about writing a simple program. I hope to get a real working  HelloWorld program based on that document's information.
 
Later possibilities....
* Do the scribble program from that same document.
* Compile and run some example programs from SuperWaba.org
* Start writing examples of some basic GUI
* Try the GUIbuilder. (It's written in SuperWaba, and is supposed to allow you to do GUI design right on your Palm. At least that's my impression, so it's worth a look.)
* Maybe buy and work through the tutorials. I have to admit the cold reception from the SuperWaba newsgroup makes me perfectly content to delay that decision until I'm more comfortable that SuperWaba will work for me. And obviously, you feel more interested in helping out a community if they don't reject you! But despite the feeling of mistreatment, I really like what they're doing, and I'm pretty sure they aren't in it for the money but out of good will and genuine interest in PDAs. So I guess for now, SuperWaba is still on my "good things in this world" list. I may change my mind later, but always best to give the benefit of the doubt. Unfortunately, I suspect that without community support, I'm sunk for any serious endeavor, so after playing around with SuperWaba enough to feel like I've learned some basics, I may jump to NSBasic or another commercial product. Or if the road gets tough with SuperWaba, I may just throw it back in the pond and go fishing elsewhere. Lots to ponder, but it's still early, so there's plenty of time to ponder those sorts of things. As I said before, so far so good!
 
Just for your reference, here's the settings I have in my palmsim.ini file. Note that there are some secureit references in there also. That's a great tip for you also that I found by experiment. Have you got a security/encryption program like SecureIt that holds passwords and such, but doesn't have a desktop version? Well, suppose you drop your Palm into the river? How are you going to get to that essential information? You certainly don't want human readable backups laying around just in case, and they wouldn't be up-to-date anyway. Well, you could buy another Palm device. OR.... if you have a simulator set up, you can use the simulator. Install the program and the associated files with the data and voila! You can run the program on your simulator on a PC!
 
Okay, back to SuperWaba. Here's the contents of my .ini file for the simulator. See you next time!
 
=============================
[Settings]
ROM=C:\Program Files\TESimulator\EFIGSP\TungstenE_EFIGSP.rom
RAM=32768
DYN=2048
Sound=0
StorageProtection=1
Zoom=1
BitDepth=8
DebugThroughTCP=1
AlwaysOnTop=0
UseHostBatteryInfo=1
WindowOriginX=597
WindowOriginY=57
RedirectNetLibCalls=0
AllowedScreenDepths=32907
LastSilkScreen=
AppCreator=
CradlePort=
CradlePortType=
Standard RS-232InfraredPort=
InfraredPortType=
68KDebuggerPort=localhost:2000
68KDebuggerPortType=TCP/IP
AdditionalPorts=
TraceTarget=tcp:localhost:25998
GremlinsFromValue=0
GremlinsToValue=0
GremlinsSwitchAfter=0
GremlinsSwitchAfterValue=0
GremlinsStopAfter=0
GremlinsStopAfterValue=0
GremlinsSelectedApps=
GremlinsFirstApp=
GremlinsAllowScreenUpdates=1
GremlinsWindowOriginX=0
GremlinsWindowOriginY=0
LogErrorMessages=0
DirectScreenAccess=0
ExtendedMemoryChecks=1
LastStorageSnapshot=C:\Program Files\TESimulator\storage_snapshot.ssf
StorageSnapshotFile=C:\Program Files\TESimulator\storage_snapshot.ssf
LowDensityMode=0
MRU_PRC[0]=C:\Program Files\TESimulator\AutoRun\Secure_It_Templates.PDB
MRU_PRC[1]=C:\Program Files\TESimulator\AutoRun\Secure_It_Secrets.PDB
MRU_PRC[2]=C:\Program Files\TESimulator\AutoRun\Secure_It.PRC
MRU_PRC[3]=C:\Program Files\TESimulator\AutoRun\HelloWorld.pdb
MRU_PRC[4]=C:\Program Files\TESimulator\AutoRun\HelloWorld.prc
MRU_PRC[5]=C:\Java\SuperWabaSDK\lib\LSW.pdb
MRU_PRC[6]=C:\Java\SuperWabaSDK\lib\HSW.pdb
MRU_PRC[7]=C:\Java\SuperWabaSDK\lib\MSW.pdb
MRU_PRC[8]=C:\Java\SuperWabaSDK\lib\xplat\SuperWaba.pdb
=============================

Monday, July 12, 2004

ED: Success! (There's Always A Workaround)

YIPEE! While I may have hit a couple roadblocks due to Sony and a lack of response from the SuperWaba community, I think I'm going to be okay with a workaround. And tomorrow night I'll sleep, sleep, sleep because I sure didn't leave much time to do that tonight! It feels a little like I'm in college again.

Quick Recap of the Situation
------------------------------
I was having troubles making things work with my Sony Clie and SuperWaba. I could run code on my SJ33 directly, but couldn't test it in an alternate location (applet viewer or emulator). That's important to me because I can't be making backups every time I want to try my code. But the PDA is my only PDA so I don't dare running "novice" code without backing up first.

The better solution is to test the code on the PC. So I tried to upload my ROM using the emulator. It didn't work and I couldn't figure out a remedy. Next I tried to download the SJ33 ROM from Sony and found that new registrations are no longer accepted, so I can't get the ROM there. (BTW, I was pleased to see that quite a few of the top Palm news sites picked up on the story really quickly. There was information on Palm Addict, OneSource, and Palm Infocenter already at last check.)

So I'm left with the Applet viewer, but I couldn't run SuperWaba code using the Applet viewer and make it look like the SJ33. The problem was that there was no way to use the font I needed to make it look "pretty." I posted a question to the SuperWaba newsgroup and was basically given the 'ole "talk to the hand" response. By this time I had another plan of attack.

Alternate Plan
--------------
I figured I could switch to the Palm Simulator (for OS5+) and code for the Tungsten E, rather than trying use the POSE emulator (for <=OS4). Actually, that is now looking like a good choice. I looked at some T|E sales on Ebay, but they were all around $150 and up. I was hoping for $100 and down, but that was not in the cards. But I think coding for the T|E simulator in support of my SJ33 may work out about the same as having a Clie emulator because of SuperWabas portability, and the screen similarities. Can't really tell yet, but so far so good.

I did install the T|E Simulator. And after some fiddling (the trick turned out to be that I had to tweak the simulator .ini file to use the last saved settings/configuration. Once I did that things worked like a charm and I could write the code in MobileCreator and push a single button to compile, create the Palm install files and run in the simulator. Pretty slick. Daniel Tauschke, the creator of MobileCreator, is my hero today. Thanks Daniel!

Some Thoughts And Next Up
--------------------------
I'm actually rather pleased so far with SuperWaba despite being snubbed by the SuperWaba community at large. And that's certainly much better than what I think about Sony right now!

This may become a theme... "Oh No!" followed by "There's gotta be a workaround" followed by "Aha!" followed by "So far so good!" and another "Oh No!"

Details about this step (getting a trivial SuperWaba program to work on the simulator and my SJ33) will come next as soon as I have time to gather my thoughts and write down what I did.

Hopefully, by suffering through this learning process, I can make it a bit easier for other novices to get past the "getting started" difficulties that we all face. Better to let me struggle and pass on the information than have thousands (well, maybe hundreds?, er.. maybe dozens?, okay maybe one more!) of us suffer the same problems independently. At least that's my theory. If anyone is getting anything out of this, whether information or simply amusement, I'd love to hear your comments!

Thanks for reading!

ED: Oh no... I'm a SuperWaba Outcast!

Well, I'm starting to feel like an outcast already. I've posted my Clie-specific SJ33 issues on the SuperWaba newsgroup. I don't wnat to jump to conclusions, but I'm getting the feel that the grand and friendly community spirit doesn't seem to exist in the Superwaba world like it does for the Palm community in general. My post to the SuperWaba newsgroup (assuming I posted it correctly) has attracted no comment. I would have appreciated even a rebuke for posting badly! Indtead my poor post just sits there ignored like the whimpy looking kid on the playground while teams are being picked for football. Maybe my post makes me look like a leper, and I just don't know enough yet to realize it.

But when I take a look at reality for the moment, SuperWaba is the only "real" game in town (so far), and I have this unexplainable desire to torment myself with Java, so I have decided to continue onward. And despite feeling a bit unwelcome, I can't believe that the SuperWaba commuity is full of unkind and uninterested individuals. Maybe they just don't care about novices. Maybe my posting was considered off-topic (I wish someone would just say so.) Or maybe my post was just not interesting or politically correct. I guess I might never find out.

At any rate, and as best I can tell, that leaves me with just a few choices:
* Switch midstream to a more "Mainstream" development environment like NS Basic or CodeWarrior C.
* Replace my Clie with something Palm like a Tungsten E. (I can see the dollars flowing out of my pocket from this experiment already.... T|E, accessories, storage card, software, tutorials for SuperWaba, professional version of MobileCreator, etc) This "free" SuperWaba thing is not turning out to be so "free" for me!
* Take my Palm and go home because no one wants to play with me. Well, I'm a bit offended, but I'm not quite that goofy. My desire to program hasn't changed. I just need a new approach.
* Do my development on my Clie directly and forget about Applet classes and POSE emulators. The problem with this is that it's my only PDA, and I can't risk data loss. My "life" is on that thing. So I have to make complete backups every time I want to run my rookie code, which as far as I know, may be a Palm wrecking ball.
* Develop for a Palm simulator configured for a HiRes (320x320) Palm OS5 device like the T|E. Then convert the app to work on the Clie afterwards when I know better what I'm doing. The only problem with this is that I really enjoy having my PDA showing the results of the code, and there's no guarantees I can convert for Clie afterwards anyway.

Well, I'm going to explore how expensive the T|E route would be tonite. But what makes more sense is to program for the T|E simulator, so that's my plan. Then it should, hopefully, be an easy port to a newer Palm when I buy my next model. Apparently SuperWaba and Sony don't play well together. Kinda like the SuperWaba community and me, I guess!

Anyone out there feeling sorry for me yet???!!!! Well, don't bother. I'll find a way to make this work. It's just a silly program, how hard can it be?

Sunday, July 11, 2004

ED: Complaint about Sony

This is an interim post editorial (ED). There will probably be a bunch of these coming up.

EDitorial posts are going to be like an editorial comment, rather than a step in learning to code. But it may give you insight occassionally to something I'm thinking about, or some of the problems I'm working on in advance of the next blog posts.

Today I am writing this blog entry because I'm a bit exasperated. I just tried to upload my ROM to the Palm POSE emulator. It didn't work, so I figured I'd Google for "Sony POSE" to find alternate ways to get the ROM. It led me to the Sony developers site. So far so good.

But when I tried to download the ROM (for the SJ33 machine I own, no less) it required a registration/login. Okay, I don't mind too much. I've been doing a lot of registrations and downloads since I started this project and one more is no big deal. Well the page for registrations indicates (on http://www.cliedeveloper.com/develop_info/index.html) the following:

================================
Dear Developers,

As a follow up to Sony's recent decision to reassess the direction of the conventional PDA market, it has closed the CLIÉ Developer Support Site registration system to new members. Existing registered developers may continue to use the tools and services on the CLIÉ Developer Support Site at this time subject to the Membership and License Agreements contained therein.

Sincerely,
The CLIÉ Developer Support Desk
================================

This is a frustrating development. I guess I'll just keep using the Palm IIIc device, which I think is close to mine. Hopefully the fonts will work out okay. Or maybe I'll try to find something with a closer match on the screen. I just have this sinking feeling it won't really work because Sony HiRes OS4.1 seems to be a special animal all it's own when it comes to fonts and display.

If I don't find a way to get hold of the SJ33 ROM image (even better with a debug version) then I suppose the best solution is to buy a Palm device, and just write code for the emulator until I get one. Bummer.

One thing's for sure. I realize now that you have to be a little bit crazy to want to inflict all this on yourself just to write a silly little program... so call me crazy!

Saturday, July 10, 2004

Java HelloWorld

Getting Started with SuperWaba – Java HelloWorld

Now I’m pretty sure that this entry is going to be frustrating for some. Why you ask? Because maybe you are chomping at the bit to write something on your Palm PDA, or read about me doing that, and here I am telling you that we’re going to take a step away from PDAs and SuperWaba to focus on Java! Yes, we probably could jump right into a Palm app on the handheld without too much difficulty. But the whole thing is still pretty intimidating to me so you’ll just have to bear with me as I do this step by step.

My goal this time is simply to (1) get some familiarity with Java and (2) write and compile a Java HelloWorld program on the desktop (WinXP).

I figured that if I couldn’t do something simple in Java, I would be totally lost when it came to trying out something in SuperWaba on the Palm. That is probably a realistic assessment. For some of you, if you’re new to all this and are following along doing your own thing with me, this step may take a bit of time. And writing a HelloWorld program may not be enough to feel a base level of comfort with Java. So you might want to go a bit farther with Java than I plan to do right now. At the same time I hear SuperWaba calling my name, so I do want to get to that soon.

Even though I call myself a novice, I do have a little non-GUI Java programming under my belt from the past work, and have both taken classes and done some work with OO design. That means I don't know much, but even to get going I needed this quick refresher now about the most basic of basics. And hopefully, that will jog my memory about some of the other basic level stuff I used to know. Since it won't take much to get me lost, I’ll dive into my Java Beginners book often.

I originally learned some Java from being put on the hot seat at work, plus a little from a book called Beginning Java (JDK1.1) by Ivor Horton. I like that book because it is simple and it doesn’t spend a lot of time on goofy stuff that doesn’t seem useful for basic desktop application programming. I also am pretty sure there’s an updated book now for Java2.

Now that’s something else I should explain in simple terms. Java versions went something like 1.0, 1.1, 1.2, 1.3, 1.4, and currently as of this writing I think 1.5 is in beta. Things changed pretty significantly going from 1.0 and 1.1 forward into 1.2 and onward. As a result, people seem to refer to 1.2, 1.3, 1.4 etc collectively as Java2. Go figure! The bottom line is that while you probably want to consider a book that uses 1.4, you especially want to make sure it’s at least Java Second Edition, or Java2 or whatever it’s called. I.e. Make sure it covers 1.2 or higher.

And if you’re looking for a good Java book, you probably don’t want to pick a book that talks about Java frameworks like Struts, or distributed objects and stuff like RMI or CORBA. (I understand that’s already like a legacy technology now anyway!?) You don’t need all that enterprise stuff now. You just need to know about the basic Java language, some simple thoughts on OO design, and how to deal with conditional logic, variables, classes and objects, inheritance, interfaces, methods, file manipulation, threads, AWT/Swing, etc. Here’s where I could probably point you better if I knew where we were headed (i.e. if I already knew Java and/or SuperWaba). But you’re along for the ride with a novice, so you’ll just have to take what I can offer.

After a lot of reading at the bookstore, the book I decided on was perfect for me as a refresher. And looks to be easy to read, covers topics I’m interested in, and is really down to earth and practical. It’s Murach’s Beginning Java2 by Andrea Steelman. (And I just noticed the similarity in titles… both books I liked are called "Beginning Java" so I must like that name for Java books!) I also have my eye on Java in a Nutshell by O’Reilly Press. But I didn’t get one because I have a Java 1.1 version, which may hold me until I find out more about SuperWaba and what I might need.

Okay, let’s get down to the nitty gritty and get that HelloWorld application running. The first thing you need to decide is what editor or IDE to use. (As I noted before, and IDE is just an integrated development environment to make it easier to code.) I decided to do HelloWorld in three places just for the heck of it. In notepad, TextPad, and JBuilder. (More registrations and downloads!!!!! I sure hope you have a broadband connection if you’re doing this with me. I can’t imagine doing all this downloading without one.)

But for our purposes here, we’ll just do it in notepad to stay generic. It will be more than enough to get the point across.

There are several things you need to do to get ready to edit and compile the code. And all of this will be in any book you have chosen on beginning Java.
1) Pick and create a directory on your PC to store your code in. I recommend something like C:\MyJavaCode because it’s simple and easy to access even from a command prompt. Plus, you may want to have directories under that for each project/application.
2) Set the path variable in Windows to include the java compiler. It’s called javac.exe and it’s one of the files that gets installed with the Java SDK. This path statement tells Windows where to look for files to execute, so when you call the java compiler, it knows where to find it. You will need to add to the path variable the name of the directory with javac.exe in it.
3) Set the classpath variable in Windows. This is another environment variable for Windows, kind of like Path, but this one is especially for Java. The idea is that Java code is grouped into Packages that contain classes. The classes are text files that define the program and contain the code, including it’s variables and program instructions. Java is different than a language like Cobol in that it isn’t all lumped into one big file. It’s made up of a bunch of classes, and each class is defined in a separate text file.

The packages and subpackages are set up like, and correspond to, directories and subdirectories. In fact, all the code files (classes) that make up a program are grouped into directories with names equal to their package names. The classpath statement tells Java where all the “top-level” package directories are. For what we’re doing, we might not ever have to create our own packages, so you can think of the classpath as pointing to the directory with your code.

Because we’re going to use a command line compiler, and call it from the same location as the code files, all you need to add to the classpath variable is “.” To represent the current directory.

If all this is confusing to you, get yourself that beginning Java book. It’s really not that hard, and those books can explain it a whole lot better than me.

Now that we’ve installed the Java SDK, and set the path and classpath variables, we are finally ready to write and execute a HelloWorld program.

Here’s the code I’m going to use. It will go in the text file C:\MyJavaCode\HelloWorld.java which has to match in name to the class name defined in the code we put inside that file.

public class HelloWorld{
public static void main( String[] args){
System.out.println(“Hello to the World from the SuperWaba blog!”);
}
}

Note that this blog may not show the indents properly. Each of the first three lines gets a different level of indent. The first "}" should be under the start of "public static...", and the second "}" is back at the left margin. Maybe later I'll figure out better how to control the formatting on this blog, but I'm in a hurry to finish this post right now.

To compile this code (from a command line on WinXP and from the same directory as the HelloWorld.java file with the program in it), you just type >javac HelloWorld.java (the ">" is the command line prompt, so don't type it in) and hopefully you get no errors, or at least they are easy to fix.

To run the program, you then type >java HelloWorld and the message should appear on the console.

That’s all there is to it, and that’s all for this time. Next time we look at SuperWaba and make a stab at HelloWorld on my SJ33!

Monday, July 05, 2004

Starting With SuperWaba

Today, I’m going to describe an overview of what I’ve discovered so far relative to SuperWaba. I knew right off the bat that there were some things I probably needed to get familiar with to program using SuperWaba: Java, SuperWaba, Waba, Palm Programming, and some associated tools or scripts.

A search on the web for SuperWaba led me to the main site, with all kinds of information. You can use either www.superwaba.org, or the site you are directed to, which is www.superwaba.com.br . There’s a wealth of information there. You can register and download the SuperWaba software. And if you look around, you’ll see links to articles and other items of interest.

(You had better just get used to the idea of some web registrations because you’ll need to do at least three of them just to get going. Plus a lot of downloading, so you’ll need either a lot of patience or access to a broadband connection.)

Anyway, I downloaded superwaba. I also registered for and downloaded the Sun Java SDK (the standard SDK edition, not J2EE, and not just the Java Runtime Edition).

And the best decision of all was to download an IDE that is built just for SuperWaba. It’s the Tauschke MobileCreator, and the personal edition is free at http://www.tauschke.com/ after you register. Basically, it doesn’t have debugger support or package support in the free edition. Both are important in big projects, but seem to me to be no big deal for the kind of thing I would be creating. There are also free alternatives if you want to use another IDE, but that’s getting ahead of myself. The neat thing about MobileCreator is that the whole process of compiling into palm installable files and testing it out on an emulator is so simple and automated that it happens with the push of a button. Once I know how that all works under the covers, I might not care so much if I have to do it on my own, but since it’s all a mystery at the moment I’m really happy to see it happen “automagically”.

Incidently, an IDE is an Integrated Development Environment, which is a fancy way to say it’s software that provides a nice way to write and keep track of code. Usually it provides features to help with things like compiling, testing, syntax, version control, etc.

So let me make a quick pitch for MobileCreator now. We should let the developers know that we novice programmers and hobbyists are appreciative that they have made this IDE available for personal use. Sure, there are some other Java IDEs that could be used with SuperWaba, and they have free versions. And certainly the MobileCreator developers will make some money by getting people hooked on a free version to upgrade later into a paid version. But let’s give credit where credit is due. By providing this for free personal use, the developer has done a great service to the Palm community, and I for one am thankful. It’s just one example of how Palm developers are the “good guys.”

Now everything thing I’m describing here is based on the “you’re not going to try to sell your software” assumption. I don’t understand all the licensing yet, but the basic idea seems to be use it for personal and/or non-profit purposes and you’re okay as long as you include the right information and credits when you distribute. If I start thinking about publishing software useful to the world, then I’ll have to learn more about licensing. But for now, I think it’s pretty safe to say that you can use it for your own personal use without any problems.

For those of you that have another favorite Java IDE like JBuilder or Eclipse, for example, you can use it with SuperWaba. There is even a free basic version of JBuilder available. Eclipse is GPL (free), has a plug in for SuperWaba, and I think it has a debugger and package support. Other possibilities are things like TextPad. Newsgroups are full of info on how to do that, but until I give it a serious try it’s out of scope for this blog. And, besides, the whole compile and build process with things like ANT, Warp, Exegen, Jump and Matchbox are kind of intimidating to me at the moment. But with MobileCreator it’s pretty much automatic. And you can even use the same code to generate for Pocket PC in case you’ve “gone over to the dark side” as they say in Palm circles.

So let’s get back to what we have to do.
--> Download and install SuperWaba
--> Download and install the Sun SDK
--> Download and install the Palm Emulator or Simulator, and
--> Download and install MobileCreator.

If I remember right, the path I took was to download all four, but for some reason I decided to install SuperWaba first and MobileCreator next. It probably looked so good I wanted to see if it was self-sufficient before I went any farther. And I believe the installation setup program instructed me to do the SDK and Emulator downloads as part of the install process! Funny thing... Most software install instructions and information for the user seem somewhat misleading or ambiguous to the uninformed user. Somehow the MobileCreator designers were able to break that pattern and write excellent instructions. They were brief and informative, and I was comfortable the whole way through. Very impressive.

To download the Palm Emulator, you need to register at http://www.palmsource.com/developers/ The Palm Emulator is what I chose because I have a Sony Clie SJ33 running OS4.1. Apparently the Palm devices running on the older architecture and processors use an emulator. In addition, you’ll need to download a ROM that has the guts of the machine you are emulating. Plus you can add a skin if you like to make it look pretty.

If you are trying to develop for Cobalt (OS6), I don’t know if any of this SuperWaba stuff works yet. I’d guess “no”, but I’m just not sure. I do think it can handle OS5 though. The difference is that, for testing, instead of using an emulator (POSE = Palm OS Emulator, I think), you choose the Palm Simulator at the Palm developer site. They have more details there if you dig around, but I think I’ve captured the basic idea. I also went for a ROM with debug built in. I think that means that it can tell you if you are using “bad” code. I.e. code that is lacking in compatibility with various devices or future versions of the OS.

The hardest part of getting all this software is really just figuring out which file to download, and knowing what part is for what. It’s pretty straightforward, especially for MobileCreator and the Java SDK (as long as you remember that the JRE Java Runtime Edition is not enough all by itself, and J2EE enterprise edition is too much.) Here is a link to load that core Java SDK: http://java.sun.com/j2se/corejava/index.jsp (as opposed to the Desktop Java which is the JRE only).

Now, if you have installed SuperWaba, MobileCreator, the Sun Java SDK, and a simulator or emulator, you are all set to move forward.

Next… Java HelloWorld

Introduction II

Today I want to share a few more details of the plan. As I learn, it will grow and evolve, but you’ve got to start somewhere. So here’s what it’s all about, in bullet form:

1. THE GOAL is to learn to code on my Palm device. Not to be an expert, but just to be able to do the things that a beginner can do. Then if I need something goofy like a utility for my PDA that calculates the number of curved vowel letters in a paragraph, I can write it myself.

2. My experience will be SHARED THROUGH BLOGGING, right here. I’m thinking that there are a lot of people curious about the same things I’m about to discover. And I would consider this whole thing a success if just one other person is inspired to give it a try because of this blog. In fact, I’ll be satisfied even if just one person enjoys following along with my adventures out of curiosity.

Because I’m learning as I go, and I’m not an expert programmer, this won’t be like a tutorial. Don’t expect a well thought out description of the best way to do things. Don’t even expect all the information to be comprehensive or even be completely correct. I’m just sharing my take on things. If you are aiming to become the next great programmer, read this for fun, but go find an expert to learn how to program the right way.

3. This blog won’t have EVERY SINGLE DETAIL documented, but it will have enough to help a lot if you’re someone that is trying to do the same things that I am. And there are a lot of wonderful sources of information that I will point you to along the way.

4. As I alluded to before, I’m a busy person, so entries MAY BE SPORADIC. Don’t expect a daily blog and a toll-free support line! I’d love to get some blog comments with your thoughts and feedback. Hearing from people that have an interest will be my biggest incentive to blog. If no one contacts me, I may just continue "bloglessly".

5. I’m NOT A PROFESSIONAL WRITER. That pretty much says it all, but note one more thing. I’m pretty nervous about sharing all this publicly. Who knows where it will lead, and how stupid I will sound, how easily I'll get stuck. All my ignorance is going to be out in the open for all to see. I say that because a thousand times I’ll probably remind you I’m doing this FOR FUN, and I’m not an expert.

6. How about the end game? Well, I hope to at least continue this blog UNTIL I’VE WRITTEN A SIMPLE APPLICATION, that has some usefulness to someone. Then if I still have the motivation, and the program turns out to be of general interest, maybe I’ll even continue to blog some of the issues involved in publishing it. For example, the licensing and packaging involved with publishing a program at PalmGear or FreewarePalm or whatever ends up making sense.

7. I will be on the lookout for the appropriate software to use in SuperWaba development. There are utilities and programs that are helpful in addition to SuperWaba itself, and I intend to make use of them if they will make life easier. Once I get a feel for what I’ve gotten myself into, I’ll try to start with something like a HELLOWORLD PROGRAM. First in straight Java on the desktop. (Baby steps.) Then on my PDA with SuperWaba. That will be time for a mini-celebration!

8. I’ll focus on A FEW SIMPLE PROGRAMS FOR PRACTICE while I try to get familiar with what’s easy and hard in SuperWaba, learn some basic skills, and get a feel for what the Palm environment means to a developer. And as I do that, hopefully some idea for a simple but useful application will pop into my head. (Or into my blog response comments if you want to help out with ideas for me to consider!)

9. THERE’S NO GUARANTEE OF SUCCESS. This is a fact of life. While I am certain that I could do this if I was willing to work hard enough at it, we are talking about something I’m doing for fun on the side in my “spare” time. If the fun ends, then the project ends. If it turns out to be too hard, I will be ready and willing to admit defeat. But, gee whiz, how hard can it be!!! :)

Well, that’s plenty enough information to give you an idea of where I’m going and what it’s all about. As I learn more about what’s involved in writing code, and start to get ideas for an application it will become much clearer. Remember, it’s not going to look formal, and I’ll probably make a lot of mistakes. If you are an experienced coder, you’ll probably get a good chuckle at many of the choices I make and things I write. But, hey, that’s just part of the fun!

Finally, let me thank all the people that have made this possible with the Waba and SuperWaba projects and creators of some of the other great tools and utilities that I will surely end up using. I intend to do nothing but support their causes and show my appreciation for their work (even if I do some complaining about the shortcomings).

I’d really love to hear someday from those folks responsible for the SuperWaba and related open source projects. I’m especially interested in what motivated them to do all that work. Was it just something they love to do? Was it to help all of us out? Was it because they wanted to see all the great things other people could do if they gave them a platform to use?

If more than a handful of people discover this blog, I’ll also gladly use this forum to help the owners of these great projects in simple ways to get the word out about the good things they have going on. And if, in my ignorance, I either publish incorrect information or suggest anything that causes trouble of any sort, please let me know so I can make an appropriate correction.

Next blog entry… Starting with SuperWaba

Introduction I

SO WHAT'S THIS ALL ABOUT?

My name is Bob, and I’m a Palm enthusiast who wants to learn to write programs for my PDA. I use my Palm every day and am a fan of the great software out there at reasonable prices. I’ve come to appreciate some of the great developers we have in the PalmOS world, and I want to learn a little more what it's all about.

I’m not really a programmer, though. I think that’s what will make this interesting to other readers who sort of know how to code, but not really. Maybe you have written some old BASIC text output programs in high school. Or maybe you took a few programming classes in college. But you haven’t really done anything significant. Maybe you feel that OO, GUI and event driven programming and design sounds simple when you read about it, but not so easy when you try it. And it sounds even worse to try it on a PDA.

Well, I'm going to give it a try. But before I begin, I feel obligated to set the scene by giving you a little information about my background relative to programming. Bear with me for just a moment.

I admit first of all that I'm not a total and complete novice to programming. But I sort of am a newbie in a way. You see I’m the not-so-unusual mix of “used to be a coder” and “can barely write a HelloWorld program”. I wrote a lot of text-based BASIC code in college. I wrote little things like a system utility for my TRS-80 Model I to make the cursor blink.

I did some more interesting things like some simple game programming with assembler for Z80 and learned the basics of Lisp, Ada, Pascal, Modula 2, Cobol, Fortran, etc etc. I entered computer programming contests in high school that required me to turn in boxes of punch cards!! In two breakneck days, I once wrote a cross assembler for my Radio Shack pocket computer. (Which had a querty keyboard, a form of Basic and undocumented access to machine code, but it had only a simple one-line LCD display of about 30 scrolling characters. Imagine that!!!)

I work in IT, but not as a programmer. Along those lines, I wrote some Java "persistence" code (the layer of code that handles database access) for a project back in the Java 1.1 days, so I used to know a little about a subset of Java. But every attempt I made at a real GUI app turned out pretty messy and went nowhere. GUI design with Visual Basic in MS Access seemed really easy, so I gave that a try. But once I got started, it just didn’t seem worth the effort because it seemed too hard and uninteresting to justify the time required.

Okay, enough fessing up. You know my background now. I’ve dabbled a lot. I even did some interesting things for fun before GUI and OO were popular. But the times have passed me by, I want to get my foot back in. My PDA is just the motivation I needed. It's something I use every day.

That motivation is increased by the existence of SuperWaba. It seems to have become pretty popular, is well thought of, and I just love the whole concept of great software provided free by the software development community for the community.

The goal is to get up to speed on the basics. I won’t worry about distributed computing and fancy Java frameworks and app servers. I just want to learn to write a real program so I can do simple stuff on my Palm. Maybe I’ll even be able to give something back to this Palm community that’s provided all that cool software I use. And in the process, I get to program and play with my PDA, so I figure I’ll enjoy the journey. My biggest hurdle might not even be learning what to do. It might be the challenge of remembering that there are much more important things going on in my life, like the people I care most about, so the time I spend on this effort must be limited.

If you’ve actually read this far, you’re definitely my target audience, because the average person would have already said “Boring!....”

But you’re obviously not the average person. You’re either curious about what’s going to happen or you also feel those same longings to program on your PDA. Maybe you even want to follow along and do a little Palm programming yourself. Who knows?... Maybe this exercise will inspire you to be one more freeware coder for the Palm community.

Next Time: INTRODUCTION II (Some more information about where this is going)