Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2005

Tip: Looking for answers? Try searching our database.

Converting record stores (Palm) to ASCII

Thread view: 
Aki \ - 27 Apr 2005 09:58 GMT
Hi all,

Has anybody here dealt with the problem of converting PDA record stores
(Palm .PDB files) into meaningful ASCII-format files?

I have a MIDlet running on a Palm PDA that uses a DataOutputStream on
top of a ByteArrayOutputStream to write data (longs and ints) into a
RecordStore.
The thing I'm trying to accomplish is extracting the long and int
variables from a handheld database (a .PBD file) after it has been
transferred to tabletop PC by the PDA's synchronization process.
I first read the bytes of the .PBD file into a byte[] variable using a
FileInputStream. From this array of bytes, I try to extract the
variables using a ByteArrayInputStream and an associated
DataInputStream. The variables are then converted into Strings using
Long.toSring() and Integer.toString() and written into an ASCII file
separated by tabulators.
Instead of the actual values of the variables, the data extracted from
the .PDB file is a series of meaningless, very large numbers.
Any ideas on what I'm doing wrong here?

Signature

-Aki "Sus" Laukkanen
"Älä multa kysy tai mä vastaan!"
"Don't ask me or I'll answer!"

Aki \ - 28 Apr 2005 17:10 GMT
Aki "Sus" Laukkanen wrote:

> Hi all,
>
[quoted text clipped - 16 lines]
> the .PDB file is a series of meaningless, very large numbers.
> Any ideas on what I'm doing wrong here?

For the information of anyone facing the same problem in the future:
Not only does the .PBD file have a constant length database header (in
my case [Palm Tungsten E, PalmOS 5.2.1] 104 bytes), it also has n amount
of record headers following the database headers [where n is the amount
of records in the database]. In the aforementioned case, these were 8
bytes long.
The best method to find out how many bytes to skip proved to be
experimenting with an incrementing amount of skipped bytes from the
start of file and printing out this amount every time the data turned
out to be valid. (The process had to be repeated a few times on varied
lengths of records to determine the length of the record header, of course.)

Damn I hate PDA manufacturers.

Signature

-Aki "Sus" Laukkanen
"Älä multa kysy tai mä vastaan!"
"Don't ask me or I'll answer!"

Josef Garvi - 28 Apr 2005 18:05 GMT
Aki "Sus" Laukkanen wrote:
> Hi all,
>
> Has anybody here dealt with the problem of converting PDA record stores
> (Palm .PDB files) into meaningful ASCII-format files?

http://www.righto.com/pilot/pdb.html

Signature

Josef Garvi

"Reversing desertification through drought tolerant trees"
http://www.eden-foundation.org/

new income - better environment - more food - less poverty

Aki \ - 28 Apr 2005 18:11 GMT
> Aki "Sus" Laukkanen wrote:
>
[quoted text clipped - 4 lines]
>
> http://www.righto.com/pilot/pdb.html

Your post came just a bit too late, I already did it the hard way. :->

Signature

-Aki "Sus" Laukkanen
"Älä multa kysy tai mä vastaan!"
"Don't ask me or I'll answer!"

Josef Garvi - 29 Apr 2005 09:02 GMT
Aki "Sus" Laukkanen wrote:

> Your post came just a bit too late, I already did it the hard way. :->

You're a patient man!! ;-)

Signature

Josef Garvi

"Reversing desertification through drought tolerant trees"
http://www.eden-foundation.org/

new income - better environment - more food - less poverty

Aki \ - 29 Apr 2005 10:16 GMT
> Aki "Sus" Laukkanen wrote:
>
>> Your post came just a bit too late, I already did it the hard way. :->
>
> You're a patient man!! ;-)

Nah, just too stupid to give up in any reasonable amount of time >-)

Signature

-Aki "Sus" Laukkanen
"Älä multa kysy tai mä vastaan!"
"Don't ask me or I'll answer!"

Josef Garvi - 29 Apr 2005 10:51 GMT
Aki "Sus" Laukkanen wrote:

>> Aki "Sus" Laukkanen wrote:
>>
[quoted text clipped - 3 lines]
>
> Nah, just too stupid to give up in any reasonable amount of time >-)

I struggled with the same problem some years ago, but wanted to do it from
Delphi. In the end, I succeeded by using a small exe file, "par", that was
very powerful in decomposing and recomposing pdb files. But a source code
solution would have been nicer.

Another way of doing it in Java is to create a conduit. Haven't tried this,
but it should integrate a little bit nicer than letting the user sync first
and then select the synced file.

A tricky issue when working with the pdb files manually is that Palm
Desktop can have multiple users. If so, it's hard to tell what folder the
PDB files will be in, or when pushing them to the palm, which one they
should be installed into. Unfortunately, the Java Conduit API does not seem
to implement a method for retrieving a list of all palm users on the local
computer. A guy named Ralph Curtis at Gabriel Software
(http://www.gabrielsoftware.com/) wrote some code that does this through
JNI by interfacing the C conduit API instead.

Signature

Josef Garvi

"Reversing desertification through drought tolerant trees"
http://www.eden-foundation.org/

new income - better environment - more food - less poverty



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.