
As I told you before, you'll learn how to build a
simple Palm OS application that writes "Mac and Palm rock!"
on the screen using the tools you've just installed (however, as said
in the read section, you won't learn here how
to write/program that application since this is not a developer's site
that teaches you C/C++ language for Palm OS applications).
That sample application, which we'll call MacPalm, has also a menu bar
and an About box.
Step One: Prepare Xcode
(If you're using Jaguar
and Project Builder please continue here.)
We will use Xcode since it's a really nice and powerful
product with many cool features like syntax coloring, syntax-aware
indentation,
cross-platform line ending compatibility (Unix-LF, Mac-CR, Windows-CRLF)
and finally it's FREE (included in Developer Tools).
Open the Xcode application (in /Developer/Applications).
Now choose "New Project..." from the File menu, select "Empty
Project", click the Next button and type "MacPalm" as
Project Name. Leave ~/MacPalm/ as location for your project folder
and hit the Finish
button.
Step Two: Download the
source code

Unstuff the downloaded archive, open the
folder called "MacPalm source", select all the files inside
that folder and drag them to the left column "Groups & Files" of
your Xcode window (under the "MacPalm" group). A dialog
box will come down, but before clicking the Add button make
sure you have selected the check box called "Copy items into destination
group's folder (if needed)".
Now you can quickly and easily access to your project's files and when
you need to edit them (not in this tutorial) you'll feel very comfortable
and productive.
You can either choose "Show Editor" from the toolbar to show the files
content on the main environment, or you can edit your files in a new
window double-clicking on the "MacPalm" group on the left; in that case
your Xcode window should look like this
one.
Step Three: Compile the
source
The source code you've just downloaded is complete and ready to be compiled,
so you basically don't need to edit and modify it. Of course, once you
are familiarized with it, you can amuse yourself and make changes, but
at this moment, please keep it simple and follow the instructions without
modifying it.
So, open the Terminal application (in /Applications/Utilities) and type
"cd ~/MacPalm/" to go to your project
folder.
To compile simply type "make".
(There's also a way to compile using the built-in buttons of Xcode:
see this
tip in the forum).
If you open the MacPalm folder you'll notice that a lot of files have
been created but what you really need are the original source files and
the new MacPalm.prc which is finally your Palm application. So, go back
to the Terminal and type "make clean";
this will remove the unnecessary files in your MacPalm folder.
Look at this screenshot
to see the compiling process on the Terminal.
That's it! You have finally built your first Palm application using PRC-Tools
on Mac OS X!
Step Four: Test your application
You can now install your fresh new application directly into your Palm
handheld (simply double click the MacPalm.prc and perform a HotSync operation)
or you can test the application on POSE
(Palm OS Emulator) like shown in this
screenshot.
If you have any problem, question,
suggestion, remark or comment, please don't be shy: USE
THE FORUM!
|