PDA

View Full Version : How easy is programming for the Palm?


GodOwnsAnNX80
01-26-2004, 02:41 PM
Let's say that I have minimal programming experience. I can do some pretty advanced javascript/vbscript stuff and maybe fudge my way through a PERL script, but that's the extent of my programming skills. Took a C++ course years ago but have forgotten as much as I learned. Same with MS VB.

So if I re-studied a little C and dove into the Palm5 SDK, would I be able to belt out a usable app in a week or two? I'm not talking about reinventing ZLauncher or making my own web browser. I'm thinking like maybe a port scanner utility or a simple hack of some sort.
Is PalmOS easyier or harder than Windows programming?

THX.

JcN
01-26-2004, 09:06 PM
Programming for PalmOS, in the perspective of a Windows programmer, may seem more difficult due to the memory and speed restrictions of a CLIE (even if it has an ARM processor and PalmOS 5 or higher). Even though I'm a n00b, I recommend using C (whether it be with DeveloperStudio, CodeWarrior, PRC-Tools, or Onboard C, but not PocketC) because C seems to produce smaller, faster applications than the languages you mentioned (especially MS VB), and it gives a developer extra low-level capabilities that are not available in RAD languages (and it allows developers to use Motorola 68K assembly if needed). Also, if you have programmed in C or C++ for Windows, PalmOS shouldn't be that alien to you. After all, it is event-driven like Windows, but it uses slightly different terminology, which shouldn't be that difficult to pick up :)

PS I'm from Oro Valley

SnipeAlot
01-27-2004, 04:38 AM
Offtopic:

Tuczon AZ!
I'm going there in 9 days :D

Going to show off my bulky, battered, old nz90 :P

Ontopic:

You can make a usable app in a week or two IF you know enough C/C++ allready :)
Does it really matter? Just throw yourself into it and try your best.

Nimiety
01-27-2004, 06:22 AM
Check out Sourceforge.net - there are tonnes of source packages being developed there for different OSs. I've never developed in C before, however, I picked up a favorite game of mine Kmoria and following the instructions, was able to compile it into PRC format - if you have it as a goal, I'd suggest the same thing: start with something you know and like, compile it, test it, and then tweak the original code a bit. It'll both familiarize you with C again and also give you experience.
Good luck...

dduran@linux
01-28-2004, 11:53 AM
When programming for performance and speed (size right now is not a major concern anymore) I would always use C or C++... Use VB Like applications if your making a simple program and you are short in time.

But that changed when i tried HB++, its fast! Just try to google about "Palm Compiler Benchmark" and see where HB++ stands... faster than prc-tools -- the gcc compiler!, and to think i just got used to gcc...

Its VB Like in design but is powerful as C, math is good, better than mathlib.c (i think)...

coolride
01-28-2004, 04:46 PM
I'm somewhat of a novice in programming in C, and I too intend to program in Palm. I wouldn't imagine it would be any different than what I've already programmed on my PC. From what I've read, C is the way to go. I plan on just diving in and just making a simple program and just keep practicing.

joelaw
01-28-2004, 10:45 PM
I am trying to figure out just what programming programs most hobbist are using. I don't think that anyone that just wants to tinker with the Palm OS will lay out $300 to $1000 for a piece of software.

There must be something CHEAPER for a tinker to try and get his feet wet without paying more for the software than for the computer itself?

What software do programmers use to write Palm programs?

Thanks, Joe L.

Cwiiis
01-29-2004, 09:48 AM
OnBoardC is free, PRC-Tools are free - I use the former for now, but imagine at some point will be forced to use the latter (one you actually write and compile your code on the palm, the other on the desktop)

dwig
01-29-2004, 12:52 PM
for joelaw: also consider "Pocket C". Its a commercial app but quite inexpensive (~$20-30). There is a desktop version (creates PalmOS apps on a Windows machine) and a PalmOS version that allows you to write small C apps on a PalmOS device that then run with the aid of a runtime file.

for "GodOwnsAnNX80": also check out NSBasic. Its not overly expensive and quite easy to learn. Its very VB-like and gives you easy access to all of the PalmOS standard controls. It compiles to P-code that uses a runtime and has the option of binding the runtime to the P-code yielding a single file executable. Min app size (either bound or including the runtime) is around 100k

Unregistered
01-29-2004, 01:27 PM
I personally use OnBoardC. I totally dig being able to do all development on the same machine that I run and test the code on. Develop an app in the park, on the bus, in the bathroom... it's amazing how much time you have to tinker, when you don't have to go boot up your desktop.

It uses standard C, and allows you to access every PalmOS API call (unlike PocketC). It will construct a skeleton app for you when you create a new project, there is a "Cookbook" available the teaches you the basics of everything, and there is a well established forum (about 20 messages a day) for developers, moderated by the OnboardC Development Team.

It's also open source and totally free, so if you want to poke into the code of the compiler, or modify the IDE to your taste, you can.

MegaManXcalibur
01-30-2004, 12:16 AM
Programming for the Palm is more difficult then Windows until you get used to it. With the Palm platform you don't have a lot of great things that a desktop has to offer, such as large amounts of memory, fast processors, or a large screen to lay things out on. Also you don't have the advantages of managed code (which I'm starting to love) so you have to manually manage memory (which is you learned programming with Java or a .NET enable lanuges you probably wouln't have encountered).

As for good tools, I use CodeWarrior (which is also what PalmSource recommends) which I got through college (if you are enrolled in college, and even high school, you can get a huge discount on CodeWarrior). It's not nearly as easy as Visual Studio but hey it works great, it also comes with PilRC Designer which makes form designing a breeze. Of coarse it uses the C language (and it can utilize C++) and the style of programming is different (you use a lot of pointers).

There are other tools and languages avalible such as java (Sun has released a VM and programming tools for Java for Micro Devices), Super Waba (similar to Java), Visual Basic (AppForge), PocketC (cheap development environment but requires the user to have the PocketC runtime environment installes), Python (the Python environment, which is forgot it's name, hasn't been worked on in a while so I don't know where it's standing for maturity), and many more. But using C and the Palm SDKs seems to be the best way to make good programs.

Also a final note on programming for the Palm expect to get into databases. Everything you want to store is kept in a Palm database (aside from text files, access databases, xml files, ect.). This is actually a really nice thing since it creates a standard (which the Palm OS has plenty of) for data storage.

If your serious about getting into Palm programming I recommend you get this book....

http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?userid=411MA30IXF&endeca=1&isbn=0764549618&itm=1

It covers almost every aspect you would want to know about programming the Palm platform. Happy coding.

coolride
01-31-2004, 03:07 PM
Thanks for the book recommendation MegaManXcalibur...I might have to pick up a copy.

Unregistered
02-03-2004, 04:56 PM
MegaManXcalibur - You can program for Palm OS in MS Visual Studio? Is it possible in MS Visual C++ (5.0)?

Also, since DevC++ uses a port of GCC, and pilrc I guess somehow work with GCC (although in Linux), is there a way I can compile .PRC or Palm Programs without GCC? Or do I have to run pilrc seperately to make the .PRC? I guess you can say I'm confused as to where all of these programs come into play in making the .PRC, so my question could be off/misleading...


I have played with OnBoard C back on my IBM WorkPad (IIIex) and ran into some trouble with it on my Clié (NX80V-JP). Oddly I just fixed it while writing this (had to delete header file so it could rebuild a new one). Well I guess that this last question was self-fixed...

Tim_axe
02-03-2004, 04:58 PM
That was me above... I really need to quite depending on Quick Reply. Anyways, I hope to at least start programming basic stuff with OnBoard C by studying the examples and then building from there. And please answer the questions if possible. Thanks. -Tim_axe

MegaManXcalibur
02-03-2004, 10:53 PM
"You can program for Palm OS in MS Visual Studio? Is it possible in MS Visual C++ (5.0)?"

To my knowlege no I don't believe the Microsoft compiler can compile code for the Palm hardware.

"Also, since DevC++ uses a port of GCC, and pilrc I guess somehow work with GCC (although in Linux), is there a way I can compile .PRC or Palm Programs without GCC?"

Yes. You can use the compiler that comes with CodeWarrior's IDE, and various other studios use their own compilers (AppForge, Java, ect.). PliRC is nothing more then resource editor for making GUIs. You need PliRC or Constuctor to make your GUI but they do not compile the program. You include your resource file into your C projects (I'm useing C since that's what I use to write programs) and compile the C project.

As for OnBoard C I believe you will need to get a resouce editor. The one listed on the OnBoard C site is Quartus which can be found here....

http://www.quartus.net/products/rsrcedit/

Unlike OnBoard C it's not free ($15).

I hope that helps you out.

Unregistered
02-04-2004, 09:56 PM
"Also, since DevC++ uses a port of GCC, and pilrc I guess somehow work with GCC (although in Linux), is there a way I can compile .PRC or Palm Programs without GCC?"

Sorry, I meant how can I compile a .PRC with DevC++. It uses a Windows port of GCC, so I'm hoping to get by without having to install Cygwin, or using CodeWarrior (cost). I read parts of an outdated text and it never mentioned how to compile with GCC or anything else, so there is a big blank area in how to do anything. It said the target processor is Motorola 68k (PalmOS 3?), so I know the 32bit Windows .EXE I can make in DevC++ obviously won't work, but how do I get a .PRC compiled?

If I stay with OnBoard C I will definately get that resource editor. But for right now I'm just playing with the "Hello GUI" example code. I feel embarassed to ask, but where would I find different functions? I can't get an integer to display after that default text (integer is a variable in a loop and changes). I'm guessing I'll have to hunt for a book or through the SDK...

Thanks for the help so far.

MegaManXcalibur
02-05-2004, 12:09 AM
First off I'm gussing your trying to dispaly the integer in a field. It's kind of a pain, but here's how to do it....

First you have to detach the handle to the field, then modify it, and then reattach the handle. Here is some simple example code right from the Palm OS Programming Bible (page 281 - 282) the code reverses the string in a field....

static void ReverseField (FieldType *field)
{
MemHandle textH;

if (FldGetTextLength(field) > 0)
{
textH = FldGetTextHandle(field);
if (textH)
{
char *str, *p, *q;
char temp;
int n;

FldSetTextHandl(field, NULL);
str = MemHandleLock(textH);
n = StrLen(str);
q = (n > 0 ? str + n : str;
for (p = str; p < q; ++p, --q)
{
temp = *p;
*p = *q;
*q = temp;
}

MemHandleUnlock(textH);
FldSetTextHandle(field, textH);
FldDrawField(field);
}
}
}

Yes all that just to flip around a string. The main parts to look at are the....

1. textH = FldGetTextHandle(field);
2. FldSetTextHandl(field, NULL);
3. str = MemHandleLock(textH);
4. MemHandleUnlock(textH);
5. FldSetTextHandle(field, textH);
6. FldDrawField(field);

1 gets the handle for the field you want to alter. 2 sets that fields handle to NULL so the OS isn't monitoring it anymore. 3 lock the textH memory so no programs can use it. 4 unlocks the memory after textH has been altered so it can be used by a program again. 5 restores the handle and 6 redraws the field so it will display the new information. Confusing enough?

To answer your first question.... no idea. I've never messed with DevC++ or used the GCC to compile a palm program. Considering how powerful the GCC is I'm betting it's possible but you'd probably have to do a google search or find somebody who uses the GCC to compile their Palm programs on windows.

Destino
02-05-2004, 04:06 AM
Hi everyone,

I'd like to know where can I download SDK for develop database for clie ux50 using also image JPG.
please help

Unregistered
02-05-2004, 01:54 PM
I just found a nice site that has lot's of tools and articles for people interested in Palm OS programming....

http://www.massena.com/darrin/pilot/tanda.htm

There are a ton of tools for download there.

Ohh and Destino here is the site where you can dowload the Sony Clie SDKs....

http://www.cliedeveloper.com/develop_tool/index.html

Hope that's what you were looking for.

MegaManXcalibur
02-05-2004, 01:55 PM
Sorry didn't realize I wasn't logged in, the above post is from me.

Edlin
02-05-2004, 10:56 PM
Just to add to all this fine information:
HB++ has very good liscence for hobbist programmers... free for freeware developers :) <http://www.handheld-basic.com/>
You do get a nag like screen built in the .prc (though they were discussing changing that) that appears at irregular times.

A site with lots of non C programing tools and resources is here <http://www.winikoff.net/palm/dev.html>

Theres a C cookbook (The intent of this paper is to provide a C programmer with all the information necessary to jump quickly into writing Palm code) at <http://onboardc.sourceforge.net/cookbook.html>

And Palm Open Source <http://www.palmopensource.com/>

JGCcom
02-05-2004, 11:02 PM
Hi everybody

i m looking for a software to use with my MAC PowerBook G4, i want to make programs that can work in my Clie Tg50

thanks in advance

JGCcom.pe