Fog Creek Software
Discussion Board




PalmOS Programming

This is sort of a two-part question:

1)

I am curious whether anyone here has experience developing for PalmOS.

Metrowerks Codewarrior seems to be the IDE of choice, but I think the cost is a little bit high for a newbie/hobbyist.

Has anyone used a different/cheaper tool set that works well?

2)

For those of you who do have experience with PalmOS, is there any reason that it would be an unusually stupid idea to try to learn C/C++ by experimenting with PalmOS apps?

I have almost no prior C/C++ experience other than a college class 10 years ago, but I am incredibly bored with my VB/SQL maintenance duties at work and am ready for a new challenge.

The reason I ask is that I have been told by a consultant (don't laugh) working for our company that the memory management involved as well as various other quirky factors make PalmOS programming *soooo* difficult that very few people can do it.  The topic came up when we were asking said consultant to provide us with the source code for some of the in-house PalmOS apps we use that he designed and had an off-site developer code for us.  He begrudgingly replied that he could certainly get the source code for us, but that it was unlikely that anybody other than the guy who wrote it could take over where he left off.  This consultant has a habit of gushing over what a *genius* his PalmOS guy is and that he can code things in 2 hours that would take anyone else 25 hours...

Comments?

Tim Lara
Tuesday, November 19, 2002

You probably don't want to try learning both C and PalmOS programming at the same time.

Programming for the PalmOS is very much working with an embedded system. You need to deal with downloading object code, setting up an emulator, debugging over a serial port, and lots of other such things. Not to mention all the palmOS specific library calls, data management, UI toolkits, and whatnot.

Add to that just learning C, especially pointers, and you've got a recipie for frustration. I'd suggest you start with writing some basic C++ dlls on Windows, and calling them from your VB apps. That way you can get used to coding in C and still take advantage of what you already know. Once you've got a firm grasp there, write a full bore C app.

Then you're ready for PalmOS. I worked on a project on this platform recently, but I was doing the PC conduit, not the palmOS side of things. Programming for the PalmOS is not incredibly hard from what I could see, but it does take a shift of mindset. Generally, you have to assume the handheld will be slow, and have limited memory. The heap and stack are VERY small, but there's a whole new "database heap" that provides blocks of ram for you.

It's a learning curve, like anything else. I wouldn't try and tackle two such curves at the same time.

Chris Tavares
Tuesday, November 19, 2002

I'd suggest VB if you want to get going quickly.

http://www.palmos.com/dev/tools/

pb
Tuesday, November 19, 2002

There's a useful FAQ here

http://tangentsoft.net/palmfaq/

There used to be a good site called roadcoders which seems to have merged into developer.com somewhere.

Bruce Perry
Tuesday, November 19, 2002

In early 2000 I wrote a commercial Palm OS app.

There are a couple choices available to you:

* Java
Free tools are available, if I recall correctly.  Easier to learn than C/C++ but syntactically the same.  This choice may appeal to you for the reasons you mentioned above.  However, it is not really considered a contender in the Palm OS space.  Here is a benchmark article comparing Java to C++:

http://www.cs.albany.edu/~mhc/Mobile/Paper/Java_vs_C.htm

* Satellite Forms
Think of this as VB for the Palm OS.  RAD development environment with easy to use DB controls.  Many serious Palm OS developers use this product to prototype thier applications.  It is considered a legitimate choice however, it is at least as expensive (or perhaps more) as CodeWarrior.  Also, I seem to recall having use some creative algorithms to handle large datasets.  You can find out more about it here:

http://www.pumatech.com/


* C/C++
Since the OS was written in C, this is considered the standard language of choice for this platform.  I used CodeWarrior and found it to be very good.  I didn't have much trouble picking up the C programming language.  Like you, I hadn't used it since university.

Just a general note about the contractor you mention, I belive he is full of crap.  I have only worked with very few 'exceptional' programmers in my time.  My experience is that their code is extremely easy to read.  Everything is usually packaged in a coherent framework which makes it easy to find your way around.  My guess is that your 'genius' programmer is just the opposite.  Expect spaghetti.  I say this because Palm prgramming is not *that* difficult.  There are some rules to follow because of limited memory and processor speed, but these are easily mastered.

beach bum
Tuesday, November 19, 2002

It sounds like the consultant doesn't want to surrender the value of his colleague's work, which is fair enough. Rather than saying no to you, he's giving you an excuse, which is not the best way of handling it.

The excuse he gives does have a factual basis, but it also sounds like something a big-noter would say. Programming for PDA's requires better C++ expertise than for desktop or server, but it's not rocket science.

The relevance is that there are lots of poor C++ programmers, particularly those accustomed to using big libraries and frameworks, and those people will indeed have problems developing for PDA's.

The person who suggested Java and other framework-type things probably does not have experience in this area. Java apps suck on PDA's. So do lots of framework apps.

PDA Dev
Tuesday, November 19, 2002

I did a fair bit of Palm programming a year or two back, so my experience may be a bit out of date. I used Codewarrior, and found it excellent on the whole. The worst part was the resource editor, which was all but unusable on the PC, but better on the Mac. You used to be able to get a free "Lite" version - from memory, the only difference from the full version was that apps developed under Lite displayed a startup screen informing people of the fact.

I wouldn't recommend this as a way of learning C though, even less C++. The environment did not come with a standard C library, and floating point support was limited - things have probably got better in this regard though. I did manage to get parts of the standard library from PJ Plauger's book going - mainly for floating point & formatting strings.  The memory management was particularly non-standard - reminiscent of the original days of the Mac, and I believe there were problems with features of C++ such as virtual functions because of this. Again, this may have been cleaned up in more recent versions.

Having said that, if you already know C the Palm can be a very pleasant environment to work in. When I was using it, it had not yet accumulated the layers and layers of godawful, insanely complex API calls that Windows has. No doubt this will be fixed in the forthcoming version 6 of PalmOS.

Andrew Simmons
Tuesday, November 19, 2002

If you don't want to spend some $$$ for PalmOS programming use PRC tools:
http://www.palmos.com/dev/tools/gcc/

you don't get some fancy IDE with it, but frankly do you need any?

as for the difficulty of writing for PalmOS, no, it is not difficult. As someone here said there are some rules to follow and the development for palmos is more like development for an embedded system rather than for a desktop.

Passater
Tuesday, November 19, 2002

An excellent and easy to use IDE for Palm programming is availalable from www.pocket-technologies.com (assuming you don't mind programming in Pascal)

Neil Butterworth
Tuesday, November 19, 2002

Thanks for all the great replies!  This will no doubt keep me busy for a while...My poor wife is probably about ready to put a hit out on Joel for creating this forum.

beach bum:

Pretty much everyone in our company thinks that particular consultant is full of crap.  Funny to hear someone else say it.  His mantra of FAST PROGRAMMER = GOOD PROGRAMMER probably has a lot to do with the fact that he is in the habit of promising clients things that not only don't currently exist but often have yet even to be fully conceived.  In that sense, something that sort of works tomorrow is obviously more desirable than waiting a month for something that works *well* that people might actually want to use - but I digress; that's a whole 'nuther topic!

Tim Lara
Wednesday, November 20, 2002

I think that learning the palm and jumping into c is not such a bad idea. Much of your learning will much better since you are excited about the palm, and thus will have good motivation. (However, learning both a new language and a platform at the same time was mentioned as a problem).

As for the palm being hard to program, well it really depends on what you are trying to write.

For example, I am constantly shocked or stunned when companies start using Codewarrier to write simple database applications for the palm.

About 90% or more of applications in the corporate world are database type applications. You can spend 4-6 weeks writing a time and billing application in Codewarrer, or use one of the many database programs and write the whole application in a afternoon.


Fact is, most palm applications involve just display of basic data, and some means to search that data. In other words, the data usually is coming from an application on the pc side (where the application is!!). The palm side is usually very basic, and simple (which translates in to a very low cost for most palm applications).

I put together a application for a tour company. On some weekends there is up to 800 people leaving on buses. Hence, they need a quick and easy for people to approach the tour guides in the parking lot where the 20 buses are leaving.

Hence, they needed to be able to search by lastname, firstname, phone number etc. After they search, the bus number they are to be on is then displayed  (along with Hotel information etc). Many people forget their bus number, or are meeting friends who have their tickets. Thus, this is much better than looking through a long printout (and you can’t search the printout by first name if it is in lastname order). After a name is found, then clicking on another button would then also show their rooming list (who they are staying with at the hotel). In addition, the list could be filtered by bus a number, and the thus a bus “list” could be viewed for any bus that is leaving.

So, we have lot of functionally in the above application. To code that above application in Codewarrer would be a lot of work.

I used HandiBase, and the whole application including the database export routines was done IN LESS THAN 3 HOURS OF TOTAL WORK!.

In other words, why in the world are so many people writing database stuff on the Palm in Codewarrer? I mean, yea..if you are writing some GPS software to tie in with a real-estate application then I can see using codewarrer.

For the other 9 out of ten applications, use a database, and you will almost need no code. (at least for searching, sorting, filtering and display of data!).  In addition, the database applications for the palm handle the sync stuff, and again it would be foolish to write you own conduit in CW.

So, is writing a application for the palm easy? Yes, if you use the right tools.

Programs like dbase and ms-access caused a real boom in the early days for  PC’s, because every new application did not have to be coded from scratch. The same goes for the palm…use a database, as I see incredible silliness in most applications that are being written using CW for the palm.

I used HandiBase for above application…(it was $30).
Check out:

http://www.ddhsoftware.com/handbase_palm.html

Albert D. Kallal
Edmonton, Alberta Canada
Kallal@msn.com

Albert D. Kallal
Wednesday, November 20, 2002

Just in case you decide to look into a Palm 'DMBS': Satellite Forms is great as long as you don't need to use OR in your filters (2-level split OR 4-level split); Handbase only allows 6 (I think) criteria. Thus, for my application neither of these otherwise excellent products is suitable, leaving me no choice but to code things up from scratch. And I hate coding from scratch :)

For the record, I discovered SF's lack of OR after I had already gotten fairly deep into the application (yes, bad planning!), so I ended up simulating it by applying each element of the OR separately and walking the result set setting a flag, then filtering on that flag. Not exactly a high-performance solution, but it turned out to be good enough for small-market realtors.

Ron

Ron Porter
Sunday, November 24, 2002

I actually have used Satellite Forms a bit, and I agree that it is a very nice product overall.  You are right in that its weakness seems to be in dealing with complex filters or (in our case) tables with lots of rows.

The consultant working with our company originally designed our app using Satellite Forms, but eventually had to outsource it due to perfomance issues.  In our case, we needed to have a product database of 20,000 items or more on the Palm and be able to look up pricing, descriptions, movement history, etc while scanning barcodes on products out on the shelves in our stores.

For apps that don't deal with tons of data, though, Satellite Forms is definitely worth looking at.

Tim Lara
Sunday, November 24, 2002

Hi... I'm the technical lead at Metrowerks for their Palm OS tools and am the current "mastermind" behind CodeWarrior for Palm OS.

This discussion is interesting.  I agree that bare CW is inappropriate for a lot of database tasks.  However, I'd argue that we've been doing a lot to make this better.

First, I know of three companies that have built database code generators that work with CW to produce custom DBs you can embed into your apps.  Extended Technology Systems ( www.exts.com ) has a nice generator called da Vinci that produces well-optimized flat-file DB code.  Falch.net has their Visual Database Designer which does some UI work as well, but isn't as sophisticated on the database side, and then there is Sybase's iAnywhere, which is really nice with its embedded SQL DB solution and relational DBs, but carries a runtime royalty.

Second, I hope anyone looking at CodeWarrior takes the time to look at our new version 9 tools coming out in mid-December.  We've done a lot of updating to the IDE, we've rewritten major parts of the debugger, we have new tools to build fast ARM code for the new Palm OS 5 devices, we've added command-line tools for people that prefer makefiles over IDEs, and we have a new resource designer as an alternative to the Mac-look-and-feel Constructor.

For more info, see my weblog at www.palmoswerks.com .  Thanks!

Ben Combee
Sunday, November 24, 2002

I forgot to mention that V9 also comes with the Object Library for Palm OS V4, a excellent C++ class framework that automates a lot of Palm OS's quirks, including event handling, memory management, and communications code.  POL also provides a framework for custom controls, and comes with tree controls, tab controls, and grid controls that can really speed up app development time.

Ben Combee
Sunday, November 24, 2002

I am not sure this will help you or not. However, good luck.

For those know VB or delphi, while come to develop Palm program, it is better to use Satellite Forms Application.

For those know Java better, can consider using waba. Of course this is depends on you.

I think all the programming is almost similar, just that the symbol might be slightly different.

mh
Wednesday, August 25, 2004

*  Recent Topics

*  Fog Creek Home