View Full Version : Palm Database application
rmcroft
03-06-2007, 03:28 PM
I am looking to create a Palm database application for my Senior Project. I have been able to development the Interface but I'm not exactly sure about connecting to the built in Palm database or if there is a free database that I could use. I bought the book Palm OS Programming Bible but when I type in the code it gives me an error. I'm currently using the Palm OS Development Suite for development. I also looked into a tutorial I found online but when I compiled it it also had errors so I feel stuck. I tried to get the sample code off http://www.access-company.com/ but all the links I found were invalid. Please Help!
potter
03-07-2007, 09:36 AM
A few pointers:
If I remember correctly, there are some sample applications that came with the Palm OS Development Suite. I think they are somewhere in the SDK directory tree.
If you could post more detail as to what error(s) you are getting, we may be able to point you in the right direction.
There is an open source Palm database application, Pilot-DB (http://pilot-db.sourceforge.net/).
rmcroft
03-07-2007, 07:21 PM
When I try to get the samples off the PalmOS dev site -- Access-Company site there is an error. I am going to this link http://www.access-company.com/developers/downloads/codesamples/databases/classic.html and clicking the Knowledge Base #98...
how in what I'm trying to do in the actual Palm the error is that I'm trying to read "low memory" but I don't know how to access low or high or any memory. What I was trying to do was add a record to the database but I'm not exactly sure how to do so. The books and the sample I got off http://mobile.eric-poncet.com/palm/tutorial.html haven't exactly worked yet so :(
phreakonaleash
03-07-2007, 08:48 PM
HI,
low memory means that what you are trying to write to is system protected, in an area that may contain importatnt data.
It's for OnBoardC, but this guide also is 100% compatible with pODS: http://onboardc.sourceforge.net/cookbook.html
It's a tut, ref, etc..
Luck be with you, welcome to 1src and the Dev community
rmcroft
03-08-2007, 08:39 AM
Thanks that looks like it should be very helpful.
phreakonaleash
03-08-2007, 10:14 AM
Anytime holmes. Welcome to the source
rmcroft
03-11-2007, 06:50 PM
So I've kinda got it working. I'm used the PalmDB to setup the database but I want to create me own app that will work with the database. I was able to connect to the database from the app that I'm creating but when I tried to read the records I had already placed in the database it was a lot of garbage but I did see a number I had entered. Any ideas on how to easily read data from the PalmDB database in another App?
phreakonaleash
03-11-2007, 06:56 PM
You'll have to dredge up the source for the Pilot-DB app, too see how the structures are defined. Then interface this in to your app to decode the mess.
rmcroft
03-11-2007, 07:26 PM
How exactly do I dredge up the source?
phreakonaleash
03-11-2007, 07:43 PM
Download it...
http://sourceforge.net/project/downloading.php?group_id=621&use_mirror=superb-east&filename=pilot-db-1.1.3-src.tar.gz&9035799
This si the pointer to the source.
in particular check;
/pilot-db/src/design.c
/pilot-db/src/edit.c
granted I don't have the code atm, so these may not be the right directories... Try grepping your root download directory for union and see what it turns up. (in windows, search for files containing union then find it in that text)
All else fails, ***as a last resort***, mail the developer... ask what the structure for the DB records looks like.
btb, waht device do you have, since it is in the older devices sectioN?
rmcroft
03-11-2007, 09:05 PM
well the one that I got from my prof is a m505 and I have Tungsten but its at home
phreakonaleash
03-11-2007, 09:21 PM
Oh, i was joust interested. T|X ftw over here.
rmcroft
03-15-2007, 09:15 AM
So I was able to get my records printed out but I was wondering if there was a way to parse out the information that I need. I tried to look through the code but I really haven't been able to find anywhere that they create a new record or parse out an old one :(
Cyker
03-15-2007, 12:31 PM
Yeah - I was looking to try and fix some of the more evil crashing bugs in PilotDB, but the source code is quite messy :(
As it is, the project has stagnated for some years now :(
phreakonaleash
03-15-2007, 01:53 PM
I personally love it. never crashed once over here. The way I understand, It is just a record wit the structure of the data saved to it, but I may be wrong. Just create a new record and write the data to t, or just delete teh record you want to... I think ;-o
rmcroft
03-26-2007, 01:25 PM
I get that but I'm not exactly sure how to get the data out of each record.
I have it so that it prints out what is in each record using:
record = DmGetRecord (dbRef, i);
if (record == 0)
continue;
pChar = MemHandleLock (record);
WinDrawTruncChars (pChar, 30, 2, (10*i)+20, 50);
where i is a number between 0 and the number of records
But it prints out like squares then the value I'm looking for but I'm not sure how to get it to only print out the information I'm looking for.
I have attached a picture of what the print out looks like hopefully that will show you what I'm talking about. Thanks
Becky
phreakonaleash
03-26-2007, 01:44 PM
WinDrawTruncChars (pChar, StrLen(pChar), 2, (10*i)+20, 50);
^try this^
rmcroft
03-26-2007, 01:48 PM
But I want to be able to take out only the information that I want --- not have all the information before lets say the word "Chest"
phreakonaleash
03-26-2007, 01:51 PM
What is the structure of the record in DB? What types were they?
rmcroft
03-26-2007, 01:53 PM
It goes - Integer, String, Integer, Integer, Integer, Integer
phreakonaleash
03-26-2007, 01:56 PM
Create a typedef like that, then get the record into that. like
typedef struct{
int i1;
char* s1;
(...)
}data;
data DATA;
data*pData;
pData =(data*) MemHandleLock (record);
rmcroft
03-26-2007, 02:04 PM
Taking this project on just makes me feel very stupid --- because here's my next question: the (...) do I leave it like that or do I have to put something in it to tell it what the different values would be -- I'm done most of my college work using java or C is still rather new to me :(
phreakonaleash
03-26-2007, 02:07 PM
that meatnt fill in the structure with the correct data types :-)
rmcroft
03-27-2007, 12:27 PM
So once I have it into that data structure how do it get it out?
rmcroft
03-27-2007, 12:59 PM
So new question I'm using Palm OS Developer Suite and I'm just having soo many problems with C is there anything that I can do using Java instead of C? or a software kit that can help me more then the one I'm using?
phreakonaleash
03-27-2007, 01:58 PM
Try here for java: https://pdn.palm.com/regac/pdn/page?Page_Name=PUB_JAVA
As for teh retrieval lets say you want the char*:
char*buf=data->s1;
this will make buf equal to s1.
rmcroft
04-09-2007, 09:01 AM
So I decided to use the PDA Toolbox instead of hand coding it and its worked really well but now I want to try and create a conduit to transfer the information to the desktop but I'm not sure how to do that does anyone know of any tutorials or anything to help me with that?
phreakonaleash
04-09-2007, 01:54 PM
Download the CDK (conduit dev kit) off of Palm (or Access, can't remember...).
rmcroft
04-11-2007, 06:58 PM
So I downloaded the CDK but I'm not really sure how to create the dll?
vBulletin v3.0.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.