View Full Version : PalmOS Programmer wannabe
xyeta
05-01-2003, 08:31 PM
I have no programming experience, although I am very technically adept and intelligent.
I want to learn programming, but do not know where to begin, or what language would be the right place to start.
I am willing to try "teach yourself" methods to learning programming, or better yet, some REAL instruction.
Since my main interest is learning a programming language which will help me develop PalmOS applications, what language would you recommend I learn?
Let me further say that I hope to one day develop Palm applications which will function much like webpages do now. Data driven, with some input, but not something the user has to input much to get to the information.
I envision applications similar to what the medical community now uses on their handhelds. LOTS of info, easy to get to and navagate.
Advice appreciated.
:)
ayasin
05-02-2003, 12:56 PM
Ok, I'll start this religious war :). I personally would recommend that you learn C or C++. I wouldn't try to learn it on the Palm though. The debugging cycle is _far_ more painful than on a PC. Get a cheap copy of Visual studio for Windows and learn the basics. Once your comfortable with the language, you can switch over to Palm (it's just a matter of APIs at that point).
Books:
For C/C++
The C/C++ How to program books are pretty good beginner texts
For Palm:
PalmOS Programming Bible (hands down the best)
Token User
05-02-2003, 01:18 PM
Hmmm. Holy wars ... I'll join Ayasin's crusade.
If your target platform is only likely to be PalmOS, learn C. Learn the intricacies of & and *. Become one with >>, !=, ||, and ;
Honestly, everyone will tell you the you should learn to program an object oriented languge. Great response for a platform with large storage and memory opportunities, but inappropriate for the constrained PDA (and cellphone) environments. Coding for a PDA reminds me a lot of programming for a mainframe in the 80's - you are tight on memory and have limitied CPU capacity to work with, so you need to do clever things, and write "tight" code. OO languages (C++, Java) abstract so many of those details that it is MUCH easier to program a robust application, but far more difficult to get something running fast in limited memory.
If you are talking more of a client server based model, the options are greater, but will firmly land you in two camp - Java, and C++ (or Microsofts latest incarnation - .NET). Personally I am a Java fan. I cut code, I don't do "drag and drop" through a visual IDE :), but many will have other opinions.
For books - I still use a copy of "SAMS Microsoft C Programming" my coding bible from the late 80's, "Programmming in C" by Kernighan and Ritchie, and all four volumes of Steven's "Programming UNIX". Just about anything from the O'Reily catalogue is a good reference, but not ideal for instruction.
xyeta
05-02-2003, 02:45 PM
Much gratitude!!!!
This is the info I was looking for. I'll check back as it goes.
!!RESPECT!!
kdn102
05-08-2003, 06:34 PM
Originally posted by Token User
..For books - I still use a copy of "SAMS Microsoft C Programming" my coding bible from the late 80's...
Holy cow! That's the book I used to learn C! It was a really good book. Unlike the manure they are spewing forth these days, most of which are written for someone with an 8th grade learning ability.
What I just love are these 700+ page monster books with the title 'advanced' or 'programmer to programmer' written somewhere on the cover. Here's a quote from a VB.NET book with 'programmer to programmer' on it (annotations are in []'s):
"Classes are created using the Class keyword [1], and include definitions (declarations) [2] and implementations (code) [3] for the variables, methods, properties, and events that make up each class"
Now really, what language do you know of where an object is described by a name other than the object name? "Here we have an integer, but instead of calling it an integer or int, we're going to call it fred" *laugh*
This is nuts! Unless this programmer only ever wrote in logo they will know that declaration and definition are one in the same.
Really, a programmer not knowing that writing code is called implementation? I'm too perturbed to comment on this!
It's a sad day when you buy a book entitled "Professional VB.NET" and it appears to be written for someone with little to no programming experience.
Oh my gosh! *lmao* Each chapter has a summary at the end to tell you what you just learned! This is funny! It sounds like a high school text book!
Ok, enough, I can't stand anymore! I'm putting the book back into my coworkers office!
Token User
05-08-2003, 07:37 PM
I think that your reasons are the ones why I still keep the SAMS book around, and still recommend "C" as a language that people should learn if they want to do more than drag and drop VB scripting. Even the best of us need a refresher on pointers ocassionally (IMHO - the best AND worst feature of C :)). This was a great complement to K&R's "Programming in C" and K&P's "UNIX Operating System" book ...
(Sidenote: people think how great Linus Tovalds is for creating Linux ... but forget that without Kernighan, Pike, and Ritchie - and others at Bell Labs, there would be no *nix OS).
xyeta
05-14-2003, 12:48 AM
Ok, I am halfway thru an C tutorial.... I am understanding more than I thought I would ;)
There is something I am just not getting yet....
Basically, I want to create a way to navagate thru a lot of (relatively static) data. Graphically, ideally, but here is an example:
Say you wanted to create a product catalog for Sony PDA's. You have a lot of information in a database about each Clie. Your catalog would look something like this:
You start on a welcome screen that has pics of the various Clie lines: TG, NZ, NX, SL/SJ, NR, T, N, S. The user selects (taps on) NX and a new page loads that shows the NX series options: NX60, NX70V, NX70V/UH...again, tap NX60 and the user is shown a nicely layed out page that shows a pic of the NX60 and specifications, etc.
Basically, I want it to work like a webpage does.... very little user input to navagate lots of database driven info. Very user friendly. Current PalmOS database applications can do some of what I want, but there is very little control over output. The data I want to manage is relatively static....
How do I make this a reality? What am I not getting?
TIA!!
TechnoCat
05-14-2003, 10:07 AM
Originally posted by kdn102
It's a sad day when you buy a book entitled "Professional VB.NET" It's a sad day when Professional and VB are used in the same sentence.
Sort of like saying, "Extra tasty Syrup of ipecac.
TechnoCat
05-14-2003, 10:30 AM
Originally posted by xyeta
Ok, I am halfway thru an C tutorial.... I am understanding more than I thought I would ;)
There is something I am just not getting yet....
Basically, I want to create a way to navagate thru a lot of (relatively static) data.Sort-of like navigating through a database?
You separate your data from where it's going. Somewhere you'll want to store the data, perhaps in your case in a structure or in a database that loads to a structure.
For example, and avoiding pointers to keep it easy for you initially...
Your header file might include...
typedef struct {
char[20] szClieName;
int iClieMem;
int iClieSpeed;
byte[10000] bCliePic; // 8-bit color by 100x100 graphic
} clieData;
// A similar more advanced class would use pointers instead...
// And would have constructors/destructors, though those
// aren't real relevant to a very simple class.
class clieDataClass {
public:
clieDataClass(byte* pMem);
char* pszClieData;
int iClieMem;
int iClieSpeed;
byte* pzCliePic; // 8-bit color by 100x100 graphic
};
And your .c file might include...
// Back to C... and keeping it simple still
// How ever many clies you intend to support
#define NUM_MODELS 10
clieData pDataSource[NUM_MODELS];
clieData* getDataOn(char* pszModel)
{
for (int x = 0;x<NUM_MODELS;x++)
{
if (strcmp(pDataSource[x].szClieName, pszModel)==0)
return &pDataSource[x];
}
return NULL;
}
void fillForm()
{
// Assumes a CListBox called "clbModels"
for (int x = 0;x<NUM_MODELS;x++)
clbModels.AddString(pDataSource[x].szClieName);
}
Hope this helps a bit.
DanOhizumi
05-14-2003, 10:50 AM
Hey, if you are interested in making programs for palm thats web based look at AvantGo products. Where I work at I develop apps that are web based and use AvantGo M-Business Server. All you need is good knowledge of javascript, html and etc (making webpages). Another good RAD tool used is Satellite Forms, by Pumatech. But eventually the apps that we build using RAD tools are rewritten in C. These RAD tools are good in starting to program PalmOS apps.
xyeta
05-14-2003, 11:32 AM
Mucho thanks to both Technocat and DanOhizumi!
Back to work... I'll continue to check in
!!RESPECT!!
Note to Danohizumi: I am not interested (per se) in web based applications. However, the Palm app I envision will function similarly , in that the user will click on a text/graphic 'link'and be shown a preformatted 'view' of the info in the db.
Token User
05-14-2003, 12:49 PM
Originally posted by xyeta
Note to Danohizumi: I am not interested (per se) in web based applications. However, the Palm app I envision will function similarly , in that the user will click on a text/graphic 'link'and be shown a preformatted 'view' of the info in the db.
This sounds relatively simple. For starters I am a C bigot - have an aversion to OO for some obscure reason. When I first read what you wanted I thought "Linked List" (or technically, a linked list of linked lists of data structures). This DOES involve a knowledge of pointers, but only at the simplest, most benign level (linked lists are a basic "C Programming 101" type concept).
But, after reading what you are trying to do, you would probably be able to get away with a simple array of data structures. when a user clicks on a button, you will KNOW what they are after, and can just jump to the appropriate array index.
My biggest piece of advice if you go down this track is to NOT use hard coded numbers, but use "#define" statements to abstract the numbers eg
#define MODEL_NX70V 10 ;
#define MODLE_NX60 11 ;
Then, when you reference ClieArray[MODEL_NX70V], it will look up the 11th array element (remember, the first element of an array is "0" not "1").
OK, so this is basic C code, and pretty transportable.
NEXT step is to NOT use internal memory structures, but explore the PalmOS database libraries. This will allow you to abstract your UI and code from the data, letting you load new datafiles (PDB), rather than recompiling and reloading the app (PRC) every time you make a change to the data.
Not going to spoon feed you, since you sound like you have a clue. Go exploring :) ... but remember to backup your Clie before running any new apps you might have written on it. Since everything is in memory, a rogue pointer in C can do a lot of damage.
TechnoCat
05-14-2003, 12:54 PM
Originally posted by xyeta
the Palm app I envision will function similarly , in that the user will click on a text/graphic 'link'and be shown a preformatted 'view' of the info in the db. In that case, you've got some database stuff ahead of you. You'll need DmQueryRecord(), you'll need to lock it down, and you'll need to decide how wasteful you want to be.
Space on the PC is cheap; 20GB disks are now small. Space on the Palm is pricey. So you "pack" data. Instead of a 20-character string for a name, e.g. "Tony "
"Charles "
"Harry "Most databases simply null-terminate the strings..."Tony\0"
"Charles\0"
"Harry\0"In this case, you save about 72% of the space! But... you have to do pointer math. And you have to carefully design your schema... if you have constant-size pups (like numbers, such as "Speed" or "RAM"), you want those at the start of the structure so you don't have to calculate their positions. The strings (device name, processor name) then might be... Char* pDevName, *pDevProc;
pDevName = (Char*)&(pDevStruct->devName); // devName is first var-sized element in struct
pDevProc = pDevName + StrLen(pDevName) + 1; // +1 is for null or null term
// Now you can copy them, or plug into fields or struct...
StrCopy(nameDesc, pDevName); I really agree with ayasin... start with the desktop, not the Palm. Debugging on the Palm is a bugger.
TechnoCat
05-14-2003, 12:57 PM
Originally posted by Token User
My biggest piece of advice if you go down this track is to NOT use hard coded numbers, but use "#define" statements to abstract the numbers eg
#define MODEL_NX70V 10 ;
#define MODLE_NX60 11 ;
Then, when you reference ClieArray[MODEL_NX70V], it will look up the 11th array element (remember, the first element of an array is "0" not "1").Generally you should avoid having any data in the program. Look up three messages; I suggested instead simply looking them up from the database as needed. That way he doesn't have to recompile when a new model comes out... just add another to the database.
Token User
05-14-2003, 04:12 PM
Originally posted by TechnoCat
Generally you should avoid having any data in the program. Look up three messages; I suggested instead simply looking them up from the database as needed. That way he doesn't have to recompile when a new model comes out... just add another to the database. I agree (and that was the gist of the paragraph that followed), BUT if you are learning C, arrays and linked lists are basic data structures that you should know about. Setting up variable length records and doing pointer offsets and pointer math is great - but learn to access data in a structure first (use an array of structs), then move to basic pointer manipulation (ie do a linked list of structs), and THEN start doing the pointer math and variable length stuff. Walk before you run.
Once you have gone down that path, and are comfortable manipulating data, look at external database files (complete agreement with you, that this is the ultimate place to be ... its just the path to get there that we seem to differ on).
TechnoCat
05-14-2003, 05:10 PM
Ah, yes, I see that now. I had responded to the first part of the message, never reading the second part due to shock at the first part. Sorry about that.
Xyeta, Token has a good point. You can get quicker and easier gratification starting it his way, which may help increase your motivation as you see positive results. Staying in the game is the only way to get really good at the game.
xyeta
05-16-2003, 08:37 PM
This might just be developer heresy, but....
Why don't I just do it in HTML and then use iSilo?
??
Token User
05-16-2003, 09:00 PM
Originally posted by xyeta
This might just be developer heresy, but....
Why don't I just do it in HTML and then use iSilo?
?? STONE HIM! STONE HIM!! If you start saying foolish things like that in here, you'll get bit shifted left and have your pointer dereferenced!
Geez :rolleyes:, what next AppForge? :D
Actually, not a bad idea. Back on my Visor and Palm VII, I built a number of references around Palm PQA format. All that is is a compiled HTML page. If you don't reference anything off the device, it was fast, and didn't need the overhead of something like iSilo.
wyattwong
06-06-2003, 05:26 AM
Is it possible to develop NX applications using Java or .NET ?
Token User
06-06-2003, 12:23 PM
Java - yes. There are Java JVMs out there for PalmOS. They are not official Sun JVM's, so compliance with J2ME is not 100% ... but it certainly is an option. however, they do not refernce the hardware very well, so are basically only good for generic apps.
.NET is an interesting beast. You CAN NOT write an applicaiton using the .NET framework for PalmOS, but you CAN write an application that adheres to the .NET interoperability protocols (effectively XML and SOAP). So, you can write a .NET compliant app, without touching the .NET framework. Microsoft distinguish these apps as Gold level compliance (.NET communications, written with .NET framework), or Silver (.NET communicaitons compliance).
Sooooo ... Java, yes, but only for basic, generic apps, and .NET only from a compliance perspective.
wyattwong
06-06-2003, 12:28 PM
Any URLs for more information ?
Token User
06-06-2003, 03:52 PM
I quickly googled (suggest you do the same, try keywords like KVM Java PalmOS Palm)
Anyway, I was wrong (I admit it). Sun did write and bles the Java KVM.
A good place to begin on programming Java on a PalmOs device is this article (http://www.javaworld.com/javaworld/jw-11-1999/jw-11-device.html). Good info, and a list of useful links.
Enjoy.
vBulletin v3.0.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.