[EMAIL PROTECTED] wrote:
Thanks a lot for your detailed response. A lots of basics got cleared form
your response. I just wanted to ask one more thing .. can we attach a file
with an application? i.e. with PRC. means after I install my application on
the device, it should also copy my file on to the device
If you have to have a separate file, this will make the install process
more complicated.
You have three choices:
(1) Tell the end user to install both files.
(2) Use an installer, like the PalmSource Installer:
http://www.palmos.com/dev/tools/installer/
(3) Put an image of the extra file into your app (as a resource) and
then use DmCreateDatabaseFromImage(). This only works well if
the separate file is small.
> ( I should be able to get the file path ).
If it is installed in the storage heap (internal to the Palm) and not on
a VFS device, there will be no path. You will need to use DmOpenDatabase()
or DmOpenDatabaseByTypeCreator() to open it.
If it is installed on a VFS filesystem (like an SD Card), then there will
be a path. You will need to choose a policy of which filesystem to search
first in case there is more than one VFS filesystem. (For example, on
the T5, there is an internal flash filesystem and there can be an SD Card
as well.) You will also need to choose which directory to search. I
believe the directory that the HotSync will choose for a given VFS
filesystem can be determined by using VFSGetDefaultDirectory() and
passing ".PDB" or ".PRC" as the second argument.
One further complication with external files is launching an app from a
VFS filesystem. If you put your application's PRC on a VFS filesystem
in the directory that the launcher searches, the launcher will be able
to launch it for you. It does this by copying the PRC to the storage
heap, launching, then removing the app after it exits. Thus, as the
developer this is handled automatically for you, and usually you don't
need to worry with whether your application resides on VFS or in the
storage heap. However, to my knowledge the launcher does not copy any
accompanying files and there is no way to make it do so.
Many people solve this problem by requiring accompanying files to ONLY
be in the storage heap and not on a VFS filesystem. This makes coding
simpler, but it is one more thing for the end user to understand and
keep track of.
- Logan
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/