Mark Cushman wrote:
I am adding Bluetooth support to my Palm application (http://cushman.net/projects/palantir/) and I've run into a problem while testing on my Tungsten T5. Because I am testing Bluetooth functionality, I must test changes I make to the BT code on my device. The quickest way to get a new .prc version from my PC where I compile (prc-tools) to my T5 is the Secure Digital card and a cardreader. This is my process on my Win2k development box:

1. Compile the app, resulting in a test.prc file
2. Copy the app to a small SD card using Windows Explorer, overwriting the file on the SD card if it exists
3. Right-click on the drive letter for my cardreader and Eject the SD card
4. Insert the SD card into my T5 and tap the application icon

This does not always get me a new version of my app on my device! I'm going nuts here trying to find out where the app is being cached. I have checked the dates and file sizes and they match between my PC and the SD card, but my T5 does not "get" the changes (I print out the version number on application launch). I can even copy the .prc file from the SD card to a simulator session and I get the right version.

So what can I do to kick my T5 into realizing there is a new version of the app on the SD card and to run that?

Just a guess, but what may be going on is this:  when Palm OS wants to
launch an app on the card, it first copies the PRC to the internal
RAM.  Then, it launches it.  Then, when the app exits, it erases the
copy that's in the internal RAM.

That way, you appear to be running it from SD Card, but the OS doesn't
have to deal with all the complexities of what would happen if you
were *actually* running it from SD Card.

However, what happens if this process is interrupted?  What happens
if you have the following sequence of events?

1.  You launch app from SD Card.
2.  Palm OS copies it to storage heap in RAM.
3.  Palm OS launches app.
4.  You hit soft reset button, or device crashes.

In that case, the app never gets deleted from the storage heap.
And then, NEXT time you launch the app from the SD Card, what does
the OS do?  It goes "hey, this is already IN memory, there is no
need to waste time copying it", and it just launches the in-memory
version and remembers not to delete it after the app exits.  Presto,
you have a "stuck" version of the app in the storage heap.

So, one procedure that might work for you (if I have correctly guessed
the problem) is this:

1.  Build the PRC.
2.  Copy it to the SD Card.
3.  BEFORE you insert the SD Card into the Palm, run FileZ or something
    (or even the built-in launcher) and verify that the PRC doesn't
    exist in the storage heap; if it does, delete it.
4.  THEN insert the SD Card.
5.  Then launch from the SD Card, which should ensure that you are
    getting the current version of the app.

One of the difficulties here is that if you have other databases with
the same creator code, then using the built-in launcher to clean up
this situation will delete the databases, which might be inconvenient
for testing purposes if you need them to test.

Personally, I find it's much more convenient just to hotsync the app
onto the device every time I want to test.  I often hit the hotsync
button as I start building to make sure all the other crud is hotsynced.
Then when the PRC is built, I hotsync again, and it doesn't take long
to install the app because the app is the only thing that has changed
since the last hotsync.

  - Logan

--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to