Someone may already have suggested this, but all applications receive a
sysAppLaunchCmdSyncNotify whenever a HotSync operation has occurred. By
handling this launch code, you can determine if a HotSync has occurred, and
whether or not yours ran. You could, possibly, run your reconcile during
this launch code, also, being aware that global variables are not, in
general, available.
The HotSync log on the PC and the handheld are different. Sync Manager uses
different APIs to write to them, SyncAddLogEntry for writing to the
handheld, LogAddXXX for writing to the PC. You should probably not depend
on the logs to determine what has happened.
If you haven't already, you might also try the Conduit Development Forum,
http://www.egroups.com/list/conduit-dev-forum/info.html
for answers.
Regards,
Steve
-----Original Message-----
From: Robert McKenzie [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 21, 2000 12:40 PM
To: Palm Developer Forum
Subject: RE: sync notification
thanks Richard and Rick.
I realize that the hack will work, but I am loathe to use it.
I like the backup date idea. I only need to update
my information if my app runs. If I sync back at any desktop
where my conduit runs, existing code will do a complete update
as part of the sync process.
To restate: the problem I am attempting to attack
arises if datcn (datebook's conduit) pushes data onto the
palm during a sync WHEN MY CONDUIT DOES NOT RUN. If the
user subsequently launches my app on the Palm, he will not
see this data, though it will be visible in datebook. I
want to know to do a full reconcile with datebook if
a hotsync has occurred immediately prior to this app
launch. (My conduit already leaves unmistakable evidence
that it has run, so I will know when it hasn't -- IF
I know that the hotsync happened.)
But watching the backup date on DatebookDB puts
me hostage to the behavior of datcn, any of its potential
replacements, and/or the hotsync manager. That is to
say, does the backup date NECESSARILY change with
any sync that writes to a database?? Or does it only
change if the conduit doing the modification tells it
to change? Looking in the Palm OS 3.0 sources, the
only changes to the backup date in DataMgr.c are done
by the DmSetDatabaseInfo() routine. Looking in the
Sync Manager API documentation I find no reference to
a database's backup date. This leads me to conjecture
that the Hotsync manager resets the backup date automatically,
but this is merely conjecture. Anyone know?
An alternative idea (of mine) is to watch the hot sync log.
I had thought that it was stored in a database owned by
the Palm hotsync manager, but I cannot find any such database.
Anyone know where it is stuffed on a Palm?
-bob mckenzie
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Richard
Bram
Sent: Monday, March 20, 2000 1:40 PM
To: Palm Developer Forum
Subject: Re: sync notification
>
>I believe that each database has it's own "last
>backed up" date.
>
>When your app starts, it could compare the
>backed-up date on the datebook db against
>a date for the last datebook db backup that it
>remembers privately.
But this will only work if the user happens to
run your app in the interim between when she syncs
to one computer and when she syncs to the other.
If not, then your app won't get a chance to test for this.
I think you really need to write a (trivial) hack to
do this. Just patch SysAppLaunch to monitor when
Datebook gets a sysAppLaunchCmdSyncNotify launch command.
Then the hack sends the message to your app, which could
process the databases just post Hotsync.
Rick
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html