|
Post by canto86 on Feb 18, 2006 19:55:40 GMT 1
I was just wondering what kind of code you use to write programs for palm. Do you use a different code for writing palm emulators like LJP than when writing programs that arent emulators? Right now I am in a computer programming class but would like to try something more than just java. Do you know of any one or any websites that I could go to to learn how to create programs for palm devices?
|
|
|
Post by Tinnus on Feb 19, 2006 2:59:08 GMT 1
USUALLY... we program in C or C++. Java is possible but usually not practical because it is interpreted. Emulators aren't any different from normal programs regarding the "kind" of code They are just more complicated most of the time. Take a look here: www.palmsource.com/developers/You should try programming in VB (if you have Windows) or C for a desktop first though, because these are 'real' languages, ie they're compiled, different form Java. Not to mention it's easier than starting right away with Palm
|
|
|
Post by _Em on Feb 19, 2006 4:38:53 GMT 1
The trick is that there are general libraries of code built into the OS that you can call from your own code -- this is called an API. Windows has a specific API, PalmOS 5 has its own; anything compiled that depends on API calls is able to patch into those prewritten bits of code. On the Palm, this becomes useful for doing things like displaying buttons, text, anything with the SilkScreen, etc. LJP uses less of this kind of code than many Palm apps; there is more that has been written from scratch (I think).
For example, a simple text editing app can use the text input API, some database calling routines, and a few buttons and maybe some menu and modal dialog references. What it actually does is tie pre-written code together in new ways.
Because LJP is doing something new, more of the code needs to be developed from scratch, as the program itself doesn't behave the way most Palm apps do.
|
|
|
Post by Tinnus on Feb 19, 2006 12:31:14 GMT 1
And a System API is somewhat the same as the Java object library... but instead of classes it's usually just functions so you cna use it from C. But the purposes are along the same. The Java object library is some kind of soup consisting of System API + standard lib (general-purpose functions like the stdlib in C).
|
|
|
Post by canto86 on Feb 25, 2006 17:40:29 GMT 1
so your saying that I should just learn C then once I have learned a bit of that try working on palm projects? I went to the link you posted and got some documentation on palm programming. There were like six different adobe files that were all ranging from 42 pages to 2000 pages or more. well I Hotsynced them onto, what else, my palm and am starting the very long project of reading them. Also, do you know where I could get free resources on learning C or C++. I should let you know that I dont even know much java. I am still only half way in to my first year of class. We are working in the shelly cashman series and are still only in chapter 5. So resource for beginners would be vrey much appriciated.
|
|
|
Post by Tinnus on Feb 26, 2006 0:13:52 GMT 1
Screw your Java classes then, you won't get far in this rhytm. Just google for C or C++ tutorials and you should find some pretty good stuff to learn programming on your own.
(basically if you've got a normal brain, in a month you should be doing some pretty nice stuff like text games. hehe)
|
|
|
Post by _Em on Feb 27, 2006 4:03:37 GMT 1
Actually, if he's taking a CS class, his Java course isn't really about Java, but about structured programming using Java as the simple learning language. He should make sure he internalizes what he learns in that class, as most of the stuff will be completely transferrable to C and C++ -- although the object oriented stuff won't be (no, C++ isn't really an object oriented language; it's just object oriented frills tacked on to C; hence the post ++ ). I'd suggest learning ANSI C in parallel, and taking stuff you're learning in your course and trying to apply it to C using the C syntax. Once you get comfortable with C, learn some of the C++ constructs; this shouldn't be very hard, as other than the actual syntax, they're not too different from Java. Also, if you can get your hands on a non-MS operating system, it's trivial to compile C and C++ code on the command line using gcc; I find it much easier to figure out what's actually happening using this method... something you'll need to know when advancing to lower level asm languages and hardware simulation code. If you need to stick with Windows, you might want to download MinGW or Cygwin; these will both let you use gcc in a Windows environment. This method won't really help you make pretty programs like Visual C/C# would, but there's nothing like compiling your first hello world program on the command line, typing ./hello and seeing the screen fill up with hello world hello world hello world....
|
|
|
Post by canto86 on Feb 27, 2006 14:06:39 GMT 1
Alright I'll take your advice.
|
|
|
Post by JeremySmith on Feb 27, 2006 16:36:34 GMT 1
This method won't really help you make pretty programs like Visual C/C# would, but there's nothing like compiling your first hello world program on the command line, typing ./hello and seeing the screen fill up with hello world hello world hello world.... Good old hello world. Speaking of Visual C++/C# for anyone that is interested you can download the express editions of Visual Studio 2005 for free (the downloads are avalible until Nov 7th, 2006) msdn.microsoft.com/vstudio/express/default.aspx
|
|
|
Post by canto86 on Mar 2, 2006 16:48:39 GMT 1
I went to palmsource and tried to download the developer suite but it wouldnt let me. any time I click on the link nothing happens. Does any one know of any other software I could use. Also, do they make software so that you can type code on your palm and then transfer it to your pc to compile it. Preferably an actual program for programming instead of just memo's or something. And does anyone know of a C++ compiler for Mac.
|
|
|
Post by Tinnus on Mar 2, 2006 18:45:53 GMT 1
There's OnboardC for programming, compiling and debugging all on your palm.
|
|
|
Post by _Em on Mar 2, 2006 18:50:23 GMT 1
If you're using a Mac, you're going to have more problems than you should compiling to a PalmOS target -- the PalmSource and CodeWarrior packages are for Windows only [edit] Looks like I was wrong -- CodeWarrior PalmOS is available for OS X too (although it costs a pretty penny)! However, if you have the MacOS developer tools (should be on CD, also available from ADC), you already have all the developer tools you need in that regard -- Macs come with gcc (command line) as well as xCode, which is a complete development environment -- you can compile C/C++/ObjC/Java from xCode, as well as Python, Ruby, Perl, and a number of other languages. It all comes "free" with OS X. The other things you'll need for Palm development can be found here: osx-palm-tools.sourceforge.net/More software and tools by that author can be found at perso.wanadoo.fr/fpillet/ -- he does all his PalmOS development on OS X.
|
|
|
Post by canto86 on Mar 2, 2006 21:30:45 GMT 1
Tinnus I think thats exactly what I was looking for. I needed the mac compiler because I wanted to compile a program at school and I didnt know if the computers there had a compiler. At home I use a windows so do you know of any alternative software sources for that. Also, I have been having this problem with internet explorer. When I click on a link that would open a new window it only opens a frame showing the window that is behind it or an empty frame and nothing else happens.Does anyone know what is causing this and how to fix it.
|
|
|
Post by Tinnus on Mar 2, 2006 22:48:37 GMT 1
|
|
|
Post by _Em on Mar 2, 2006 23:09:39 GMT 1
Well, that only fixes half of the problem Tinnus... it gives him a working web browser, but his computer will still be rife with spyware. Step 2 is to use firefox to download MS AntiSpyware and Spybot Seek & Destroy. Install them, update them, and clean all the crud out of your computer. SpywareBlaster would also be a good idea.
As for compiling on Windows, Palm's development environment is a free download, and CodeWarrior is the $400 option.
|
|
|
Post by beavis on Mar 3, 2006 0:38:37 GMT 1
I went to palmsource and tried to download the developer suite but it wouldnt let me. any time I click on the link nothing happens. assuming you've already registered as a developer? I have, tho yet to develop anything. things have progressed so far since I dabbled in BASIC... btw apologies to anyone i offended in my last post.
|
|
|
Post by canto86 on Mar 3, 2006 1:41:26 GMT 1
Ive already got spybot seek and destroy. I'll go ahead and get firefox though. By the way, isn't OnboardC for C programming cause Im having trouble using C++ with it. I havent really looked at C. I just skipped to C++. If it isn't for C++ then do you know a program for palm OS that would work with C++?
|
|
|
Post by Tinnus on Mar 3, 2006 3:16:53 GMT 1
I don't think there's any. But I don't think you really need the C++ stuff for Palm... not to mention sometimes it doesn't work right For example most of LJP is written in C. Only some of the moduels are C++...
|
|
|
Post by _Em on Mar 3, 2006 17:56:29 GMT 1
C++ is only really useful in very specific situations; as the underlying logic is all C anyways, it doesn't give you a compile advantage or anything, and you can actually create almost all the C++ constructs with a few defines in C. In modern programming, a good solid grasp of ANSI C is always a plus anyway -- it (the knowledge) is portable to C++, Objective C, and Java (as well as Python, Perl, etc.)
|
|
|
Post by tgwaste on Mar 7, 2006 14:01:04 GMT 1
Can you develop Palm apps via a UNIX (console) environment or do you need the SDK?
I know C, but when I code it I use 'vi' in unix... I've never been able to figure out all that SDK garbage.
regards...
|
|
|
Post by _Em on Mar 7, 2006 20:31:17 GMT 1
SDK = software development kit. It's a collection of pre-written code and header files required to compile to a specific target without having to have all the hardware specs and OS specs memorized.
You can write code in any text editor you want... the trick is that you have to COMPILE it against some framework. On UNIX, this is usually (but not always) gcc. Usually people include the UNIX/Linux/whatever SDK libraries when they compile with gcc, and call functions in their code that come from these SDKs.
As you aren't compiling to Linux or UNIX (or even anything remotely POSIX) as your target, you'll either need to do everything from scratch, or find an SDK that is compatible with your compiler. Considering people are compiling to a PalmOS5 target on OS X using xCode, which uses gcc, my guess is that you could do the same thing using vi and gcc.
Of course, you could just write everything in ARM ASM using Palm's ASM developer kit; then it doesn't really matter WHERE you write the code, as you compile it by hand anyway.
|
|
|
Post by tgwaste on Mar 8, 2006 6:28:42 GMT 1
Well of course im using GCC to compile things in Linux, what else would I be using? Im not really sure how to phrase my question another way... My question remains the same. I want to develop in a Linux enviorment (not Xwindows). and of course I have all the basic Linux utils and functions at my disposal.
|
|
|
Post by _Em on Mar 8, 2006 17:50:16 GMT 1
|
|
|
Post by Tinnus on Mar 9, 2006 0:14:21 GMT 1
Of course you can't use the normal gcc that ships with Linux to compile Palm apps. You need the prc-tools stuff, including gcc for palm.
|
|
|
Post by canto86 on Mar 14, 2006 23:02:39 GMT 1
I need some help. In some example code it has this code:
1 #include <stdio.h> 2 3 int main() 4 { 5 int a; 6 a = 0; 7 while (a <= 100) 8 { 9 printf("%4d degrees F = %4d degrees C\n", 10 a, (a - 32) * 5 / 9); 11 a = a + 10; 12 } 13 return 0; 14 }
Why is there a 4 in between the % and the d in line 9?
|
|
|
Post by _Em on Mar 15, 2006 0:31:08 GMT 1
|
|
|
Post by Tinnus on Mar 15, 2006 2:38:36 GMT 1
Of course this code is not useable for Palm But follow my suggestion: learn how to program in C in Linux then try to move later. Don't do crazy like me and start right away with Palm OS...
|
|