In an application I work on I will exchange some data files when the
Pocket PC is cradled. I will use RAPI from the desktop to copy files
between PPC and desktop. I know about other ways to exchange data like
using webservices, RDA etc but for this application it will be done by
simple file transfer using RAPI.
What happens is the following:
1) The desktop user start the the transfer process form the desktop
application.
2) PPC application need to export some of the data from the application
to a file. This is done either by the user pushing a transfer option in
the PPC application or a program is started on the PPC by using RAPI.
3) Desktop application copy the exported file from 2) to Dekstop and
process data
4) Desktop application copy files with data to be imported on the PPC
(possibly changed lookup tables)
5) PPC application import the new files into the database.
Step 5 could be done when the PPC application starts but the way this
application will be run it might be that the application is still
running.
If I choose the option to have the user start the transfer process then
it is pretty simple. Just wait for new files to be created then process
them and reload the datasets. However when two processes are running and
especially like this when on two separate computers it do raise some
possible problems. One computer does not know how when a process has
finished or not, but you can of course check for created files or having
the desktop computer to write to registry when process is finished or
something. But still, you need to be prepared for communication failures
etc.
I could probably also use the OpenNetCF filewatcher class to react when
new files to process have arrived on the PPC.
However, it would be best if the entire syncronization process could be
initiated from the desktop application without the user having to do
anything on the PPC. This should not be that hard to do, the desktop
program could launch a separate program on the PPC using RAPI which
exports and imports data. That seems like a clean and user friendly way
to do it.
However there is one problem that remains to be solved. If the PPC
application is still running I need to either close it or to use some
interprocess communication method (openNetCF?) to tell the application
to refresh datasets etc.
Questions:
1) Which method would you choose? Using a seperate program on PPC to
export/improt data or have the user start the transfer process in the
application? Any other betetr mthods to do this?
2) Can you show me some example shwo to use IPC with .NEt compact?