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?

RE: File transfers between PC <> PocketPC by RaduMotisan

RaduMotisan
Tue May 08 09:11:02 CDT 2007

Hello Magnus, my first advise would be to try to keep things as simple as
possible.

You don't need to implement a file monitor for this. There are several other
simpler approaches, lets pick one:

You could use a File Flag , a simple empty file: The ppc would delete it if
exists, then start Step1 as you descriebed. On step4, the Desktop creates the
file on the PPC using RAPI. So the existance of this file means that the
process is complete.

In your PPC application you could have a timer, that looks for that file. As
soon as it appears you know the transfer has been completed, you can go to
Step5 (and you can delete the file flag at this point).

I could think of some other similar approaches, all very simple. I hope this
helps.
--
Best regards,

Radu Motisan

http://www.teksoftco.com/forum
Windows Mobile Development Forum


"Magnus Bergh" wrote:

> 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?
>
>
>
>
>

Re: File transfers between PC <> PocketPC by r_z_aret

r_z_aret
Tue May 08 15:56:20 CDT 2007

On Tue, 8 May 2007 13:52:55 +0200, Magnus Bergh <magnusb@sbbs.se>
wrote:

>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.

You can get the transfer to start automatically when the ActiveSync
connections is made. For more info, use google
(http://groups.google.com/advanced_group_search) to look up
cerapiint registry
in this newsgroup.

clip


>
>
>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?

I agree with the earlier post that one app makes sense. We provide two
methods, and let users choose. One is a RAPI app that runs when a
device is cradled. The other runs on the handhelds when the user
chooses, and uses ftp.



>

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com