>I've attempted to use the Notification Manager, but had absolutely no
>luck with it. In particular, I don't get a app launch code at all! If
>anyone (devsupp?) has working code of this, I'd love to see it.
Here you are. Of course there's no Notification Manager before 3.5, and so
on earlier devices you have to hack it with one of the methods already
covered in this mailing list.
(This'd let you do a password upon every power-on or app launch; change as appropriate
for your needs.)
#include <PalmOS.h>
UInt32 PilotMain( UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
{
UInt32 romVersion;
UInt16 cardNo;
LocalID dbID;
// See if we're on the minimum required version of the ROM or later.
FtrGet(sysFtrCreator, sysFtrNumROMVersion, &romVersion);
if (romVersion < sysMakeROMVersion(3,5,0,sysROMStageDevelopment,0))
return 0;
if ((cmd==sysAppLaunchCmdSystemReset) || (cmd==sysAppLaunchCmdNormalLaunch)) {
SysCurAppDatabase(&cardNo, &dbID);
SysNotifyRegister(cardNo, dbID, sysNotifyLateWakeupEvent, 0,0,0);
}
if ((cmd==sysAppLaunchCmdNormalLaunch) ||
((cmd==sysAppLaunchCmdNotify) &&
(((SysNotifyParamType*)cmdPBP)->notifyType == sysNotifyLateWakeupEvent))) {
// do your password stuff here
}
return 0;
}
>Also, the docs suggest that having a EvtGetEvent timeout prevents (?)
>the processor from going into Doze mode. Does this really have an(y)
>impact on battery life?
Yes; doze is different from sleep. A device is nearly always in Doze mode,
even when it looks like it is fully on. Dozing is a low power mode, but
the screen is on and it is waiting to see if you press the screen or a key
or whatever.
If you pass a 1 second timeout to EvtGetEvent, it has to wake up from
dozing at least every second for you. After 2 minutes (or whatever the
user set) it'll go to sleep; the EvtGetEvent timeout doesn't prevent that.
-David Fedor
Palm Developer Support
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/