File Transfer using C#
-
Good Day, What is the best way to transfer files from C# to a Mobile phone? I need to transfer a small XML file. Thanks! :laugh:
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
-
Good Day, What is the best way to transfer files from C# to a Mobile phone? I need to transfer a small XML file. Thanks! :laugh:
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
There are two ways of doing this, and I've done both in applications before. The easiest way is to use ActiveSync (XP and earlier) or Windows Mobile Device Centre (WMDC) for copy the file you with a folder that is synced with the device. The benefit of this method is you simply write to a regular file on the desktop system, and it doesn't matter if the mobile device is connected or not. Worst case, the file is synced across next time the device connects. The second way, which involves a little more work is to use RAPI.DLL (you still need ActiveSync or WMDC) installed to do this. The API in RAPI.DLL allows you to connect to a device through C# and copy information to and from the device. Your best bet here would be to look at the RAPI docs on MSDN, or look at a framework from OpenNETCF Consulting which from memory, is free.
------------------------ Luke Lovegrove ------------------------
-
There are two ways of doing this, and I've done both in applications before. The easiest way is to use ActiveSync (XP and earlier) or Windows Mobile Device Centre (WMDC) for copy the file you with a folder that is synced with the device. The benefit of this method is you simply write to a regular file on the desktop system, and it doesn't matter if the mobile device is connected or not. Worst case, the file is synced across next time the device connects. The second way, which involves a little more work is to use RAPI.DLL (you still need ActiveSync or WMDC) installed to do this. The API in RAPI.DLL allows you to connect to a device through C# and copy information to and from the device. Your best bet here would be to look at the RAPI docs on MSDN, or look at a framework from OpenNETCF Consulting which from memory, is free.
------------------------ Luke Lovegrove ------------------------
Thanks for the reply, Luke. Sorry for not making things clear enough. What I would like to accomplish is not a PC <-> Mobile transfer, but a Server-Client architecture.
SERVER <--> [WIRELESS ROUTER] <--> MOBILE CLIENTS
So the Clients (MOBILE) will request for the XML file from the server, the server in turn will respond by sending the XML file from the requesting client. Please advice. I'm thinking of using web service for this and thought that others here may have a better solution. Thanks! :)It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
modified on Thursday, August 7, 2008 9:11 AM
-
Thanks for the reply, Luke. Sorry for not making things clear enough. What I would like to accomplish is not a PC <-> Mobile transfer, but a Server-Client architecture.
SERVER <--> [WIRELESS ROUTER] <--> MOBILE CLIENTS
So the Clients (MOBILE) will request for the XML file from the server, the server in turn will respond by sending the XML file from the requesting client. Please advice. I'm thinking of using web service for this and thought that others here may have a better solution. Thanks! :)It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
modified on Thursday, August 7, 2008 9:11 AM
Yeah, I'd probably suggest a web service of sorts for that. Keeping it as simple as possible is always the best thing to do, especially with mobile devices. You could hit the server directly rather than through a web service if you were so inclined as well. I haven't used the Syetem.Net namespace much on desktops or mobile devices, but I suspect it would be a bit easier code wise to request it through a web service.
------------------------ Luke Lovegrove ------------------------