views:

156

answers:

1

I have a C# application running on a server, and it needs to copy files out to multiple Windows Mobile 5.0 devices. These devices are connected to the network directly via Ethernet-enabled cradles (so they are not connected to a PC via ActiveSync).

What different options do I have for doing this? I know RAPI can do this, but I'm not sure if it can copy something directly over the network like this. Also, I know RAPI uses ActiveSync DLLs and thus requires ActiveSync to be installed, and we would prefer to avoid doing this if possible.

Is WMI a possibility? Can we use ordinary File.IO if we can somehow get the IP address of each device? Code samples or general knowledge would be most welcome.

+1  A: 

Normal file I/O isn't going to work. The devices don't have file sharing OS components, so you can't "browse" to them over the network like you might a PC.

RAPI does use ActiveSync, so not only do you have to have AS installed, the devices must also be actively connected, and ActiveSync only allows one device connection at a time, so it's not going to work for what you want.

My solution for this type of scenario has always been the same. You have to install some sort of "listener" on the devices, whether it is your deployedd app or some form of installer. Sometimes I use an autorun app on an inserted CF/SD card (all depends on your topology).

I usually have that app listen for a UDP broadcast of a "discover" packet from the PC. When they receive it, they in turn UDP broadcast out their IP address and the PC collects those. The PC then sends the files via a TCP socket to the device(s) through the listenner app.

Lately I've been doing all of the device-side pieces via a REST service hosted in Padarn to minimize the amount of comms code on the device I have to write, but you could do it all with Udp/TcpClients without too much difficulty.

ctacke
Essentially, this is what we have in place already. Clients call a web service method and get back a chunk of the large file. The highers-up would like this replaced with a push mechanism running on the server that only needs the device to be cradled (without our client software running).
MusiGenesis
There's simply no way for the device to know files are coming in. If you could just push stuff to it, it would be a huge security hole.
ctacke
This may be due to design philosophy rather than technological limitations, but a PC can push a file onto another PC on a network, assuming the second PC has shared a folder. Couldn't the same thing be done (theoretically, at least) on a winmo device on the network?
MusiGenesis
No, because the WinMo build of the OS doesn't have the required bits for being a network-browsed client.
ctacke